# Using environment variables on filebeat config file

**URL:** <https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [February 15, 2018, 8:58am UTC](https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944 "2018-02-15T08:58:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fiunchinho](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fiunchinho](https://discuss.elastic.co/u/fiunchinho)\
**Post date:** [February 15, 2018, 8:58am UTC](https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944/1 "2018-02-15T08:58:59Z")

</div>

I'd like to tag the logs coming from filebeat with the content of an environment variable, but I need to remove dashes from the environment variable. I've tried this

```
shipper:
  tags: ["agent", ${APPLICATION_NAME//-/}]

```

but even though it works in bash, it doesn't work in filebeat.

Can this be done?

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [February 15, 2018, 9:24am UTC](https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944/2 "2018-02-15T09:24:49Z")

</div>

Hi @fiunchinho,

Beats don't use the same semantics as Bash. We don't support these kind of transformations to env variables, I would recommend setting the transformed env variable outside Filebeat, before launching it

---

<div class="post-metadata">

**Author:** ![fiunchinho](https://avatars.discourse-cdn.com/v4/letter/f/a87d85/32.png) [@fiunchinho](https://discuss.elastic.co/u/fiunchinho)\
**Post date:** [February 15, 2018, 9:38am UTC](https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944/3 "2018-02-15T09:38:10Z")

</div>

Ok, thank you

---

<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 15, 2018, 9:38am UTC](https://discuss.elastic.co/t/using-environment-variables-on-filebeat-config-file/119944/4 "2018-03-15T09:38:12Z")

</div>

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