# How to change value of $alert.MachineID?

**URL:** <https://discourse.crowdsec.net/t/how-to-change-value-of-alert-machineid/2085>\
**Category:** crowdsec\
**Created:** [October 17, 2024, 1:40pm UTC](https://discourse.crowdsec.net/t/how-to-change-value-of-alert-machineid/2085 "2024-10-17T13:40:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![europacafe](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/europacafe/32/733_2.png) [@europacafe](https://discourse.crowdsec.net/u/europacafe)\
**Post date:** [October 17, 2024, 1:40pm UTC](https://discourse.crowdsec.net/t/how-to-change-value-of-alert-machineid/2085/1 "2024-10-17T13:40:53Z")

</div>

The alert message from variable $alert.MachineID is “localhost”. This notification is sent from my crowdsec docker container on my Unraid server.

Just wonder why the value is “localhost”. As I install crowdsec on 3 servers, I prefer it to have the server name value so that I know the point of attack.

Or I can use another variable for messaging?

---

<div class="post-metadata">

**Author:** ![iiAmLoz](https://dub1.discourse-cdn.com/flex013/user_avatar/discourse.crowdsec.net/iiamloz/32/386_2.png) [@iiAmLoz](https://discourse.crowdsec.net/u/iiAmLoz)\
**Post date:** [October 18, 2024, 10:36am UTC](https://discourse.crowdsec.net/t/how-to-change-value-of-alert-machineid/2085/2 "2024-10-18T10:36:39Z")

</div>

I guess this is now resolved as I answered on discord?

Replicated answer here:

If you are running via docker as the tags suggest you can provide a custom hostname via the environment variables examples

```auto
services:
  crowdsec:
     environment:
       - CUSTOM_HOSTNAME=MyCustomHostname

```

ref: [https://hub.docker.com/r/crowdsecurity/crowdsec](https://hub.docker.com/r/crowdsecurity/crowdsec)

Note: once you restart the container it will add the custom hostname but there may be duplicate records depending on how to configure CrowdSec (multiserver or single instance)
