Member since
07-31-2023
1
Post
0
Kudos Received
0
Solutions
07-31-2023
01:13 PM
I am a newbie to Nifi Jolt transform. I've been looking through the document, but still cannot figure out how to do mutiple headings for one array. input json { "dataPackage": { "datatest": { "field": [ { "Name": "test1", "content": 45 }, { "Name": "test2", "content": 20 }, { "Name": "test3", "content": 23 } ] } } } Jolt Spec [ { "operation": "shift", "spec": { "dataPackage": { "datatest": { "field": { "*": { "Name": { "test1": { "#test1": "field[&3].Name", "@(2,content)": "field[&3].content" }, "test2": { "#test2": "field[&3].Name", "@(2,content)": "field[&3].content" }, "test3": { "#test3": "field[&3].Name", "@(2,content)": "field[&3].content" } } } } } } } }, { "operation": "shift", "spec": { "field": { "*": { "@(0,content)": "firstDetails.@(1,Name)" } } } } ] current output { "firstDetails" : { "test1" : 45, "test2" : 20, "test3" : 23 } } Expected output { "firstDetails" : { "test1" : 45, "test2" : 20 }, "secondDetails" : { "test3" : 23 } } can you please help
... View more
Labels:
- Labels:
-
Apache NiFi