How to use Jolt spec to transform data in Nifi?
I want this data to be transformed in a given way using the jolt spec of Nifi. Conditions are if studentId and loc_id are the same then we will combine their info and will pass the rest as it is.…
I want this data to be transformed in a given way using the jolt spec of Nifi. Conditions are if studentId and loc_id are the same then we will combine their info and will pass the rest as it is.…
How can I transform(remove in this case) flowfile if one of the fields of the object is null using JoltTransformJson processor in nifi here below is my data. emp.json: [ { "Name" : "john Smith", "DOB" : "2000-07-14", "Salary" :…
I need help to remove null elements from JSON using jolt. I want to remove only root level elements containing null. Input : { "x": null, "y": null, "z": [ { "id": "1", "name": "2", "price": null, "quantity": 1 }…
I am trying to write a jolt specification to transform an input JSON. I have the following input: [{ "id": "11500887", "created": "2023-03-16T18:34:24.485+0200", "items": [{ "field": "status", "fieldtype": "jira", "fieldId": "status", "from": "10000", "fromString": "In Definition", "to": "1", "toString": "Open"…
I am new to Jolt. Please how do I sort the following array in descending alphabetical order Input : [ { "status": [ "ERROR", "ERROR", "REJECT", "ERROR", "ERROR", "ERROR", "ERROR" ] } ] I want status REJECT to be the…
Need help on writing JOLT spec : Input sample: { "key": [ { "sku": "015110530", "location": "0635" } ], "value": [ { "timestamp": 20230515094712, "supplies": [ { "stock_type": "C", "requirement_category": "A06100021" }, { "stock_type": "B", "requirement_category": "A06100022" } ] }…
I have two top level arrays: products and prices. I have to move all those price objects under product where price.productId == product.id. Note that there can be any number of products and prices and their relationships. My current solution:…
I have this JSON as input: { "my_array": [] } If the array is empty I need to add a placeholder to the array, so this is the desired output: { "my_array": ["placeholder"] } If the array has a value/s:…
I am having trouble dealing with arrays in JOLT. Input: [ { "id": "1", "home_phone": [ "55555555", "66666666" ] }, { "id": "2", "home_phone": [ "77777777", "88888888" ] } ] Desired output: [ { "id": "1", "home": "55555555" }, {…
I have a string field that represents JSON value { "value": "[{"field_1": "123","field_2": "id","field_3": "qwe"}]" } Is there a way in jolt to convert it to JSON, something like this { "value": [{"field_1": "123","field_2": "id","field_3": "qwe"}] } I know format…