JOLT Transformation: Moving Child name value to parent denormalize
For the below given input, how do i move the name value pairs(installDate and status) to the upper level
{
"header": {
"version": "1.0",
"timeStamp": "1670484663189",
"activityId": "256388257993155783",
"action": "create",
"refreshId": "null"
},
"resource": {
"drniId": "256383859946641699",
"@type": "LogicalCrossConnection",
"subtype": "Backplane Connection",
"name": "Backplane Connection",
"resourceCharacteristic": [
{
"name": "tmf639_dataSource_ingestion_uuid",
"value": "256383859946641699",
"@type": "string"
},
{
"name": "p16Latest",
"value": true,
"@type": "boolean"
},
{
"name": "installDate",
"value": "202303323",
"@type": "string"
},
{
"name": "status",
"value": "In Service",
"@type": "string"
}
],
"resourceRelationship": [
{
"drniId": "256387639517862117",
"@type": "LogicalInterface:HAS_CONNECTION_COMPONENT:OUT",
"subtype": "ODU2e",
"name": "ODU2e.1-8",
"relationDrniId": "256383859946641700",
"resourceRelationshipCharacteristic": [
{
"name": "p16Latest",
"value": true,
"@type": "boolean"
},
{
"name": "sectionNumber",
"value": 0,
"@type": "long"
},
{
"name": "p3CreateActivity",
"value": 256388257993155780,
"@type": "long"
},
{
"name": "isNotInRoute",
"value": "N",
"@type": "string"
},
{
"name": "p2Create",
"value": 1670480203578,
"@type": "long"
},
{
"name": "seq",
"value": 1,
"@type": "long"
}
]
},
{
"drniId": "256383859946641335",
"@type": "LogicalInterface:HAS_CONNECTION_COMPONENT:OUT",
"subtype": "ODU2e",
"name": "ODU2e.1-8",
"relationDrniId": "256383859946641701",
"resourceRelationshipCharacteristic": [
{
"name": "p16Latest",
"value": true,
"@type": "boolean"
},
{
"name": "sectionNumber",
"value": 0,
"@type": "long"
},
{
"name": "p3CreateActivity",
"value": 256388257993155780,
"@type": "long"
},
{
"name": "isNotInRoute",
"value": "N",
"@type": "string"
},
{
"name": "latest",
"value": [
2,
3,
16
],
"@type": "array"
}
]
}
]
}
}
Expected Output
{
"records" : {
"inv_activity_ts" : "1670484663189",
"inv_activity_id" : "256388257993155783",
"action" : "create",
"inv_id" : "256383859946641699",
"inv_subtype" : "Backplane Connection",
"inv_name" : "Backplane Connection",
"installDate" : "202303323",
"status" : "status"
}
}

