Logstash Version - 6.6.2
Translate Filter Version - 3.0.4
Drop Filter Version - 3.0.5
logstash-config
=============
input {
stdin { codec => json }
}
filter {
translate {
field => "comp"
dictionary_path => "/etc/logstash/conf.d/comp_enable.yml"
}
# if [component] == "rabbitmq" {
# if "[component]" == "%{comp}" {
if [component] == "%{comp}" {
drop { }
}
}
output {
stdout { codec => rubydebug }
}
======
When hard-coding the value of comp (commented line) it works as expected - the logs are dropped, I don't get anything on console as output.
But when passing with the variable it's not working as expected.
The file /etc/logstash/conf.d/comp_enable.yml has below contents:
"kafka": "disable"
"rabbit": "disable"
And I am passing the below string as input logline:
{ "component":"rabbitmq" }
Anything wrong here? Can anyone from the experts group please suggest how can I achieve this?
-Bijay