I'm looking for a way to extract the contents of an object such as
{
"mdc":{
"key1": "value1",
"key2": "value2",
...
}
}
and transform that into
{
"key1": "value1",
"key2": "value2",
...
"mdc":{
"key1": "value1",
"key2": "value2"
}
}
I was looking at the provided processors but couldn't find anything useful.
My initial thought was to:
Any suggestions would be greatly appreciated!
It wasn't that hard after all.
{
"mdcflatten": {
"processors": [
{
"script": {
"lang": "painless",
"inline": " ctx.mdc.keySet().each (key -> ctx[key] = ctx.mdc.get(key))"
}
},
{
"remove": {
"field": "mdc"
}
}
]
}
Hope this helps.