# Node.name not reflected in "host"

**URL:** <https://discuss.elastic.co/t/node-name-not-reflected-in-host/121305>\
**Category:** Logstash\
**Created:** [February 24, 2018, 12:51am UTC](https://discuss.elastic.co/t/node-name-not-reflected-in-host/121305 "2018-02-24T00:51:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikasgb](https://avatars.discourse-cdn.com/v4/letter/v/6bbea6/32.png) [@vikasgb](https://discuss.elastic.co/u/vikasgb)\
**Post date:** [February 24, 2018, 12:51am UTC](https://discuss.elastic.co/t/node-name-not-reflected-in-host/121305/1 "2018-02-24T00:51:28Z")

</div>

In logstash.yml file, we have set node.name to a specific hostname explicitly. But the host field is displayed as "localhost".  
$HOSTNAME is set to a valid hostname.

If I sepecifically hardcode the hostname like below::

input {  
file {  
path =\> "/var/log/xyz/service.log"  
type =\> "xyz-daemon"  
add\_field =\> { "service-port" =\> "12345"  
"service-name" =\> "my-service"  
"host" =\> "abchost"  
}  
}

Then, both locahost and abchost are displayed as host.

Any suggestions how to ensure node.name is picked from logstash.yml file? We are running 5.4.1 version

---

<div class="post-metadata">

**Author:** ![Makra](https://avatars.discourse-cdn.com/v4/letter/m/8491ac/32.png) [@Makra](https://discuss.elastic.co/u/Makra)\
**Post date:** [February 24, 2018, 6:46am UTC](https://discuss.elastic.co/t/node-name-not-reflected-in-host/121305/2 "2018-02-24T06:46:41Z")

</div>

> [@About host field value](https://discuss.elastic.co/t/about-host-field-value/39970):
>
> Hi. I am using udp input plugin to listen to syslog messages. The documentation says that the host field is the "The address which logstash will listen on". This is exacly what I need, but instead, host value is the IP address of the machine that sends the syslog message. Is that how it should be? Any way I can get the name of the LogStash machine no matter which plugin I am using? Thx in advance for your help.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2018, 6:46am UTC](https://discuss.elastic.co/t/node-name-not-reflected-in-host/121305/3 "2018-03-24T06:46:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
