# Use environmental variables in filebeat configuration?

**URL:** https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772
**Category:** Beats
**Tags:** filebeat
**Created:** [January 3, 2019, 9:12am UTC](https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772 "2019-01-03T09:12:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [January 3, 2019, 9:12am UTC](https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772/1 "2019-01-03T09:12:48Z")

</div>

Hi,

I would like to add some fields to some log inputs.  
Lets say I have an environmental variable `path1=my_first_instance`

Is it possible to configure something like this in the input configuration?

```
fields:
  instance: ${path1}

```

If so, will it be updated on the fly? Meaning, if I change the environmental variable, will the field value change immediately without restarting filebeat?

---

<div class="post-metadata">

### Author: ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)
#### Post date: [January 3, 2019, 9:25am UTC](https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772/2 "2019-01-03T09:25:21Z")

</div>

You can use environment variables in your configuration. See more: [https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html](https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html)

If the value of the environment variable is changed, Filebeat needs to be restarted.

---

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [January 3, 2019, 9:28am UTC](https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772/3 "2019-01-03T09:28:26Z")

</div>

thanks

---

<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: [January 31, 2019, 9:28am UTC](https://discuss.elastic.co/t/use-environmental-variables-in-filebeat-configuration/162772/4 "2019-01-31T09:28:30Z")

</div>

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