Code: Select all
if [type] == "eventlog" {
mutate {
remove => [ "SourceModuleType", "EventTimeWritten", "EventTime", "EventReceivedTime", "EventType" ]
rename => [ "Severity", "severity_label" ]
lowercase => [ "severity_label" ]
rename => [ "SeverityValue", "severity" ]
rename => [ "Hostname", "hostname" ]
lowercase => [ "hostname" ]
gsub => [
"severity_label", "info", "informational"
]
}
}
The above is not working. I don't know why, I suspect it has something to do with renaming the field I'm trying to gsub. (although I also tried with the original field name)
The only way I could make it work was by splitting the gsub from the rename in a separate filter:
Code: Select all
if [type] == "eventlog" {
mutate {
remove => [ "SourceModuleType", "EventTimeWritten", "EventTime", "EventReceivedTime", "EventType" ]
rename => [ "Severity", "severity_label" ]
lowercase => [ "severity_label" ]
rename => [ "SeverityValue", "severity" ]
rename => [ "Hostname", "hostname" ]
lowercase => [ "hostname" ]
}
}
if [type] == "eventlog" {
mutate {
gsub => [
"severity_label", "info", "informational"
]
}
}
Or in a separate mutate in the same filter:
Code: Select all
if [type] == "eventlog" {
mutate {
remove => [ "SourceModuleType", "EventTimeWritten", "EventTime", "EventReceivedTime", "EventType" ]
rename => [ "Severity", "severity_label" ]
lowercase => [ "severity_label" ]
rename => [ "SeverityValue", "severity" ]
rename => [ "Hostname", "hostname" ]
lowercase => [ "hostname" ]
}
mutate {
gsub => [
"severity_label", "info", "informational"
]
}
}
You can close this thread if you want. Tx for the feature request.