Is there a way to read environmental values in logstash config file . I want to pass in an env value to write test cases for my logstash configs
For ex I want to do the following in my logstash config file
input {
if [ $ENV_VALUE] = test {
stdin{}
}else{
Default config
}
}
filter {..}
output
{
if [ $ENV_VALUE] = test {
stdout { codec => rubydebug }
}else{
Default config
}
}
I was going suggest using an environment filter here but since you want to wrap inputs with conditionals that's probably not going to fly. I suggest you extract your inputs and outputs into separate files and choose which ones to include when you invoke Logstash.
I think i will rather use logstash with a dynamic string as an input instead of a file name to achieve my functionality , which is @magnusbaeck suggestion
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.