# How to set source: field to local eth0 ip address

**URL:** <https://discuss.elastic.co/t/how-to-set-source-field-to-local-eth0-ip-address/145248>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 20, 2018, 9:47pm UTC](https://discuss.elastic.co/t/how-to-set-source-field-to-local-eth0-ip-address/145248 "2018-08-20T21:47:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kum](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@Kum](https://discuss.elastic.co/u/Kum)\
**Post date:** [August 20, 2018, 9:47pm UTC](https://discuss.elastic.co/t/how-to-set-source-field-to-local-eth0-ip-address/145248/1 "2018-08-20T21:47:48Z")

</div>

Hi,

Is there a way to specify that filebeat use the local eth0 ip address as the **source:** field value instead of hostname? Right now I'm doing this by overwriting the field " **source:**" in each filebeat.input, but I'd like to reuse the same VM image for multiple instances and prebake filebeat in it (which prevents me from hardcoding the ip address using this work around I just mentioned).

Thanks

---

<div class="post-metadata">

**Author:** ![pierhugues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pierhugues/32/48383_2.png) [@pierhugues](https://discuss.elastic.co/u/pierhugues)\
**Post date:** [August 21, 2018, 6:10pm UTC](https://discuss.elastic.co/t/how-to-set-source-field-to-local-eth0-ip-address/145248/2 "2018-08-21T18:10:57Z")

</div>

@Kum No, but you could use [an environments variables in the configuration](https://www.elastic.co/guide/en/beats/filebeat/6.4/using-environ-vars.html), you will need to modify Filebeat startup script to populate this variable with the value of `eth0` and filebeat will take the value from the environment.

---

<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:** [September 18, 2018, 6:10pm UTC](https://discuss.elastic.co/t/how-to-set-source-field-to-local-eth0-ip-address/145248/3 "2018-09-18T18:10:57Z")

</div>

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