# Beats environment variable not working

**URL:** <https://discuss.elastic.co/t/beats-environment-variable-not-working/243660>\
**Category:** Beats\
**Tags:** auditbeat\
**Created:** [August 4, 2020, 7:32am UTC](https://discuss.elastic.co/t/beats-environment-variable-not-working/243660 "2020-08-04T07:32:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mozam](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mozam](https://discuss.elastic.co/u/mozam)\
**Post date:** [August 4, 2020, 7:32am UTC](https://discuss.elastic.co/t/beats-environment-variable-not-working/243660/1 "2020-08-04T07:32:33Z")

</div>

Hello,

I'm using Auditbeat 7.8.0, trying to pass value to configuration using environment variables under the processors - add\_host\_metadata.

I have exported the variable in my shell using the command **export CITY\_NAME="New York"** and the Auditbeat config looks like below.

```auto
processors:
  - add_host_metadata:
      cache.ttl: 5m
      geo:
        city_name: '$CITY_NAME'

```

But the output data generated is as below.

```auto
"geo" => {
                  "city_name" => "$CITY_NAME"
     }

```

Could you please help me, to find if there is any changes to be made in order to get the proper output ?

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![MarianaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marianad/32/42687_2.png) [@MarianaD](https://discuss.elastic.co/u/MarianaD)\
**Post date:** [August 4, 2020, 10:49am UTC](https://discuss.elastic.co/t/beats-environment-variable-not-working/243660/2 "2020-08-04T10:49:11Z")

</div>

hi @mozam, have you tried using:

`city_name: '${CITY_NAME}'`

instead, per [https://www.elastic.co/guide/en/beats/auditbeat/current/using-environ-vars.html](https://www.elastic.co/guide/en/beats/auditbeat/current/using-environ-vars.html)?

---

<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 1, 2020, 12:49pm UTC](https://discuss.elastic.co/t/beats-environment-variable-not-working/243660/3 "2020-09-01T12:49:13Z")

</div>

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