# Environment variables not set in logstash 5.2

**URL:** <https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482>\
**Category:** Logstash\
**Created:** [March 6, 2017, 10:53am UTC](https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482 "2017-03-06T10:53:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinodMS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinodms/32/13476_2.png) [@vinodMS](https://discuss.elastic.co/u/vinodMS)\
**Post date:** [March 6, 2017, 10:53am UTC](https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482/1 "2017-03-06T10:53:47Z")

</div>

I'm following the instructions given [here](https://www.elastic.co/guide/en/logstash/current/environment-variables.html), but unable to get it to work.

This is the error message I get when I run logstas,

> nd "port" pre-2.0\n\tdocument\_type =\> "tm"\n\tdocument\_id =\> "%{id}"\n ssl =\> "true"\n index =\> "${LANG\_INDEX}"\n manage\_template =\> false\n }\n}\n\n", :reason=\>"Cannot evaluate `${LANG_INDEX}`. Environment variable `LANG_INDEX` is not set and there is no default value given."}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 6, 2017, 12:06pm UTC](https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482/2 "2017-03-06T12:06:05Z")

</div>

How are you setting the environment variable? How are you starting Logstash?

---

<div class="post-metadata">

**Author:** ![vinodMS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinodms/32/13476_2.png) [@vinodMS](https://discuss.elastic.co/u/vinodMS)\
**Post date:** [March 6, 2017, 1:31pm UTC](https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482/3 "2017-03-06T13:31:29Z")

</div>

Setting the environment variable on command line as follows,

> export LANG\_INDEX="en-us\_th-th"

And I start logstash as follows,

> /usr/share/logstash/bin/logstash -f segments.conf

---

<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 3, 2017, 1:31pm UTC](https://discuss.elastic.co/t/environment-variables-not-set-in-logstash-5-2/77482/4 "2017-04-03T13:31:50Z")

</div>

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