# Using environment variables in pipelines.yml (LS 6.0.0.)

**URL:** <https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674>\
**Category:** Logstash\
**Created:** [November 30, 2017, 2:05am UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674 "2017-11-30T02:05:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zpraxis](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@zpraxis](https://discuss.elastic.co/u/zpraxis)\
**Post date:** [November 30, 2017, 2:05am UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674/1 "2017-11-30T02:05:59Z")

</div>

I am trying to use an environment variable in my `pipelines.yml` file. It looks something like this:

```
- pipeline.id: test
  path.config: '${LS_SETTINGS_DIR}/test.conf'

```

I am using Linux RedHat distribution, Logstash was installed using the TAR option, I changed the default location of the settings directory, and created an env var in the`.bash_profile` to reflect that.

After running Logstash 6.0.0. with the `--log.level=debug` option, it complains with the following message:

`No config files found in path {:path=>"/home/user_account/${LS_SETTINGS_DIR}/test.conf"}`

What is the correct way to set the env var in the config file? Would appreciate your help with this.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [November 30, 2017, 4:29am UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674/2 "2017-11-30T04:29:15Z")

</div>

Which user is currently running logstash? Logstash will use the environment variable set for that user.

---

<div class="post-metadata">

**Author:** ![zpraxis](https://avatars.discourse-cdn.com/v4/letter/z/5daacb/32.png) [@zpraxis](https://discuss.elastic.co/u/zpraxis)\
**Post date:** [November 30, 2017, 8:15pm UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674/3 "2017-11-30T20:15:46Z")

</div>

The user is the owner of the "user\_account" in the previous path, and the variable is set in the corresponding `.bash_profile`.

If I do an `echo ${LS_SETTINGS_DIR}`, I get the full path as expected.

I have also tried to escape the curly braces and the dollar sign, with no success.

---

<div class="post-metadata">

**Author:** ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)\
**Post date:** [December 1, 2017, 4:02am UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674/4 "2017-12-01T04:02:23Z")

</div>

I am not so sure then!

It seems to work for me. But i have installed logstash using the apt repository and all my paths are the default file paths. I am able to call system variables from within the logstash conf. Did you try using the rpm?

---

<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:** [December 29, 2017, 4:13am UTC](https://discuss.elastic.co/t/using-environment-variables-in-pipelines-yml-ls-6-0-0/109674/5 "2017-12-29T04:13:52Z")

</div>

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