Logstash 6.3 and redis conditional on id

Hello

I have multiple redis input , I want to do some conditionnal based on key type [id] for the output but it doesn't work

example:

input {
redis {
key => "winlogbeat"
host => "x.x.x.x"
port => "6379"
password => "password"
data_type => "list"
codec => json
id => "winlogbeat"
}
}
output {
if [id] == "winlogbeat" {
stdout { codec => rubydebug }
}
}

You need to provide more detail than 'it doesn't work'. What is your configuration? What happens when you run it, and what do you want to happen instead?

There is no output, if I remove the conditional I can see the debug output , conditional with I tried multiple keys for conditional id, type etc.. and none of them seemed to work

Using id in an input plugin doesn't add a field with that name to each event. If that's what you want I suggest you add e.g.

add_field => {
  "id" => "winlogbeat"
}

to your input plugin.

great thank you

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