Json filter to parse nested json


(Harshini) #1

I have the below json

{"test1":1,"test2":2,"usage":{"test3":3,"test4":4}}

and I want the output to be
test1:1, test2:2, usage.test3:3, usage.test4:4

Also the filter needs to be dynamic, I don't know the name of the nested fields nor would I know the number of levels.


(Lm Yj Q) #2

I have the same problem, looking forward for some solutions.


(Magnus B├Ąck) #3

and I want the output to be
test1:1, test2:2, usage.test3:3, usage.test4:4

That's what you literally want? There's no standard filter for doing that, but use a json filter or codec to parse the input JSON, then use a ruby filter to serialize the resulting fields into the desired format.


(Harshini) #4

Thanks Magnus, will try that.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.