this is mainly because I could not find an answer to this and I want to know how it works/why it works.
Here are my filter examples:
(1):
if [message] in ["a","b"] {
mutate {
add_field => { "tet" => "world2" }
}
}
This works perfectly fine for messages that are "a" or "b". A new field is added. Perfect.
(2)
if [message] == "a" {
mutate {
add_field => { "tet" => "world2" }
}
}
Works perfectly fine when the message is "a".
(3)
if [message] in ["a"] {
mutate {
add_field => { "tet" => "world2" }
}
}
This does not work. If the message is "a" the check still fails and no field is added to my event.
Why does the last check fail? Is this a bug? I imagine that with typing, logstash does not thing that "a" is supposed to be a 1 element array, but I am not sure about that.
If you could also point me to some docs that explain this behaviour :)
Thanks