hi
I'm trying to send my logs to an additional output when a certain field's value is a member in a given list.
The way I go about this is wrapping the additional output part in the pipeline with an "if" condition and testing the field against a regex that will have the list like so:
output {
...
if [_ACCOUNTID] =~ /(valA|valB)/ {
coralogix {...}
}
}
when using the regex string hardcoded inside the pipeline code, it works as expected, and logs are showing up in the output.
but then, the values are changed from time to time, so I need to be able to change them (preferably automatically), so I want to have the regex string in some kind of variable, and every time the value changes I'll restart logstash.
so I tried to use this:
output {
...
if [_ACCOUNTID] =~ /(${duplicate_logs_accounts})/ {
coralogix {...}
}
}
and now this stopped working, no logs are sent to the output inside the condition.
I'm using logstash docker image 7.16.1 (docker.elastic.co/logstash/logstash:7.16.1). I'm open to upgrading if it might help
I also looked at the docs and they suggest doing exactly what I did, so I'm confused.
also, if there's any way to load some list in a better way (say, a file that I can mount to the container), I'm really open to
please help!