I am new to using Jolt specifications and need some assistance. I am trying to convert a JSON object using a Jolt specification in an Apache NiFi processor. The input JSON looks like this:
{
"keys": [
"CustomerNumber",
"CustomerName",
"IsActive"
],
"values": [
[
"12345",
"ABC Corp",
"1"
],
[
"67890",
"XYZ Ltd",
"0"
]
]
}
I need to transform this into a key-value pair format, where each object in the values array is converted to a JSON object with the keys as field names. The desired output should look like this:
[
{
"CustomerNumber": "12345",
"IsActive": "1",
"CustomerName": "ABC Corp"
},
{
"CustomerNumber": "67890",
"IsActive": "0",
"CustomerName": "XYZ Ltd"
}
]
Could someone help me with the correct Jolt specification to achieve this transformation in NiFi? Any guidance or examples would be greatly appreciated.
Thank you!