We would like to prioritize log messages of type WARN if they have a certain category.
So we receive {"type": "WARN", "category": "DefaultEmailService", "priority": 2}
and would like to output: {"type": "WARN", "category": "DefaultEmailService", "priority": 3}
The following works fine:
if [category] == "DefaultEmailService" and [type] == "WARN" {
mutate { update => {"priority" => 3} }
}
We think however that we may have many such rules and that translate would be more elegant:
if [type] == "WARN" {
translate {
field => "category"
destination => "priority"
dictionary => {
"DefaultEmailService" => 3
}
}
}
This does not update the priority field to 3 however. Why not?