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

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.

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

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.

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?

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