-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Description
The mutate filter provides support for performing a host of different operations on a Logstash event fields, yet it is not easy to copy all fields of a sub-structure at the root level. For instance, 3rd-party systems sometimes produce events such as the following one:
{
"bla": "bla",
"meh": "meh",
"payload" : {
"foo" : "1224",
"bar" : "woohoo",
"baz" : 0,
"timestamp" : 1449356706000
}
}
And what you really want is to have the payload fields at the root level and potentially discard all root level fields, like this:
{
"foo" : "1224",
"bar" : "woohoo",
"baz" : 0,
"timestamp" : 1449356706000
}
In order to support this, one could use a ruby filter, but it'd be nice if the mutate filter could support this "copy" operation out-of-the-box, too. I've picked copy but potential alternate names could be extract, reify, move, promote.
The configuration of this new feature would look like this:
filter {
mutate {
copy => {
"field" => "payload"
"empty_root" => true
}
}
}
where:
fieldwould denote the event field (must be a Hash) whose content shall be copied at the root level (can also be a sprintf-style field)- if
empty_rootis true, all root-level fields would also be deleted in the process (defaults to false)
kribor, dustin-decker, TemaSM and admlko
Metadata
Metadata
Assignees
Labels
No labels