# Insert Hostname in Filebeat Logfile

**URL:** <https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [May 14, 2018, 1:10pm UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746 "2018-05-14T13:10:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joltmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joltmann/32/20900_2.png) [@joltmann](https://discuss.elastic.co/u/joltmann)\
**Post date:** [May 14, 2018, 1:10pm UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/1 "2018-05-14T13:10:15Z")

</div>

Hi,  
I have on several Servers filebeat running. All Servers logs the the Loginformation for Filebeat under /var/log/filebeat/filebeat.log.  
Now I need to transfer the Logs vi nxlog to our Logserver. So I need an information from which host is the log entry, because on the logserver I merge all logs to one Logfile.

Is there any parameter in the filebeat.yml to add the hostname to the Logfile? I talk not about the Logs which I send to the elasticsearch like beat.host!

Thx for answer  
Joern

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 14, 2018, 2:54pm UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/2 "2018-05-14T14:54:16Z")

</div>

Hi,

I'm not sure of understanding what you try to do. Do you mean that you have configured filebeat with the `file` output and you are trying to collect these logs with nxlog?

---

<div class="post-metadata">

**Author:** ![joltmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joltmann/32/20900_2.png) [@joltmann](https://discuss.elastic.co/u/joltmann)\
**Post date:** [May 15, 2018, 6:30am UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/3 "2018-05-15T06:30:48Z")

</div>

Hi Jaime,  
no I would like to have the hostname inside the filebeat logfile (the logfile which is created by filebeat itself) But I think the best way is to insert the hostname via nxlog configuration or it is possible by filebeat.yml?

Thx for answer  
Joern

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [May 15, 2018, 7:16am UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/4 "2018-05-15T07:16:51Z")

</div>

You can add any custom field with the [`fields`](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#libbeat-configuration-fields) option. Not sure if something like this is what you are looking for.

---

<div class="post-metadata">

**Author:** ![joltmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joltmann/32/20900_2.png) [@joltmann](https://discuss.elastic.co/u/joltmann)\
**Post date:** [May 15, 2018, 7:44am UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/5 "2018-05-15T07:44:17Z")

</div>

Not really, but I have solved it with nxlog config.  
Thx for help and answer

Joern

---

<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:** [June 12, 2018, 7:44am UTC](https://discuss.elastic.co/t/insert-hostname-in-filebeat-logfile/131746/6 "2018-06-12T07:44:27Z")

</div>

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