I have a logstash configuration file (5.2:alpine) and want to use the same file for development and production environments.
I have loaded in environment variables and confirmed they exist.
However, when trying to change the output based on the environment variable (in this example [environment] is configured in the filter), the elasticsearch configuration combines both declarations and does not see them as unique settings, causing development to fail:
Just wondering if you found a way to resolve this? I'm running into the same issue. It seems like the conditionals are completely ignored in this case.
Thanks @joniba , my workaround is to use two logstash configuration files - and use the ENV var in a Dockerfile to copy the correct one across depending on the build pipeline.
I don't mind maintaining that for a little while but it's obviously a lot of superfluous code and prone to mistakes when a larger team maintains it. I'll keep an eye on that issue, thanks for the link - good to know I'm not going crazy over here...
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.