Hi i have json input like that:
{
"messageId": 1234,
"markerId": "T",
"dateFrom": 6436058131202690000,
"dateTo": -3840351829778683400,
"records": [
{
"recordId": 1,
"account": "152739203233"
},
{
"recordId": 2,
"data": {
"email": "jsmith@gmail.com",
"firstName": "John",
"lastName": "Smith"
}
},
{
"recordId": 3,
"city": "Los Angeles"
},
{
"recordId": 4,
"idNumber": "12345"
},
{
"recordId": 5,
"accountNumber": "55671"
},
{
"recordId": 6,
"account": "6789189790191"
},
{
"recordId": 7,
"city": "San Fransisco"
}
]
}
And I would like to have output like that:
[ {
"messageId" : 1234,
"markerId" : "T"
"dateFrom" : 6436058131202690000,
"dateTo" : -3840351829778683400,
"recordId" : 1,
"account": "152739203233"
}, {
"messageId" : 1234,
"markerId" : "T"
"dateFrom" : 6436058131202690000,
"dateTo" : -3840351829778683400,
"recordId" : 2,
"email": "jsmith@gmail.com",
"firstName": "John",
"lastName": "Smith"
}, {
"messageId" : 1234,
"markerId" : "T"
"dateFrom" : 6436058131202690000,
"dateTo" : -3840351829778683400,
"recordId" : 3,
"city": "Los Angeles"
}, {
"messageId" : 1234,
"markerId" : "T"
"dateFrom" : 6436058131202690000,
"dateTo" : -3840351829778683400,
"recordId" : 6,
"account": "6789189790191"
}, {
"messageId" : 1234,
"markerId" : "T"
"dateFrom" : 6436058131202690000,
"dateTo" : -3840351829778683400,
"recordId" : 7,
"city": "San Fransisco"
} ]
i need to have only this record with account, data(email,firstName,lastName) or city, i dont need records with idNumber and accountNumber. Additionally, I need each record to have a common part: messageId, markerId, dateFrom and dateTo Is it possible to do something like that with jolt transformation?