I want to move all the json node at the root level to a sub level jason node. What's the most efficient way to use filters to achieve that?
root level
{
"a": 1,
"b": "str",
"c": {"key": "value"}
}
I want the result to be:
{
"data": {
"a": 1,
"b": "str",
"c": {"key": "value"}
}
}
The most intuitive thought is to use mutate-rename filter.
mutate {
rename => { reference to the root level json => "data" }
}
However, I couldn't find a way to reference the root level json.
Thank you in advance.