I'm thinking about using the mutate
filter and the rename
option, but I don't know about the corresponding regex to achieve that:
filter {
mutate {
rename => {
"any_field_with_underscore" => "anyfieldwithunderscore" # i don't know how to write regex for this ...
}
}
}
Can anyone help?
To build on Alain's answer,
In Logstash >= 5.x, an event object accessor is enforced:
Also see this feature request that would do the same
There no indication in the doc that
rename{}
takes a regexp.I've seen this done with a
ruby{}
filter.As requested, here's some untested Ruby: