# Do filebeat has hostname variable?

**URL:** https://discuss.elastic.co/t/do-filebeat-has-hostname-variable/298665
**Category:** Beats
**Tags:** filebeat
**Created:** [March 2, 2022, 7:11pm UTC](https://discuss.elastic.co/t/do-filebeat-has-hostname-variable/298665 "2022-03-02T19:11:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Gyrops](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gyrops/32/102525_2.png) [@Gyrops](https://discuss.elastic.co/u/Gyrops)
#### Post date: [March 2, 2022, 7:11pm UTC](https://discuss.elastic.co/t/do-filebeat-has-hostname-variable/298665/1 "2022-03-02T19:11:18Z")

</div>

I need to configure a hostname variable in my filebeat.yaml configuration file without using host system variable. It's doabble?

How is now:

```auto
fields:
  source: myhostname

```

How I would like it to be:

```auto
fields:
  source: ${hostname}

```

---

<div class="post-metadata">

### Author: ![marcus\_lhisp](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@marcus\_lhisp](https://discuss.elastic.co/u/marcus_lhisp)
#### Post date: [March 14, 2022, 7:10pm UTC](https://discuss.elastic.co/t/do-filebeat-has-hostname-variable/298665/2 "2022-03-14T19:10:44Z")

</div>

Hello,

I think I understand what you want to accomplish, but guessing helps neither one of us.  
Maybe you could provide some context in regards of the Goal, please?

Wild guess, automation of beat deployment/installation?

Regards,  
M.

---

<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: [April 11, 2022, 9:10pm UTC](https://discuss.elastic.co/t/do-filebeat-has-hostname-variable/298665/3 "2022-04-11T21:10:56Z")

</div>

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