Reputation:
I need to modify output to from this
"payload": {
"a": "value",
"b": "value",
.....
}
to
"a": "value",
"b": "value",
.....
I was looking at record_transformer but it looks like this is only to for example add new field or modify value of existing json property. Is it possible to extract data like i want to?
Upvotes: 0
Views: 396
Reputation: 564
You can try something like this [If key names are fixed]
@type record_transformer
<record>
a $${record["payload"]["a"]
remove_keys payload
</record>
Or this plugin for dynamic keys https://github.com/kazegusuri/fluent-plugin-flatten-hash
Upvotes: 0