Questions tagged [jolt]

A JSON to JSON transformation library written in Java.

Jolt is a to JSON transformation library written in .

For more information, see the GitHub page.

Latest release: 0.1.6 released on Mar 28, 2022

1312 questions
3
votes
2 answers

How to use shift and modify-overwrite-beta in jolt

I want to know how to use shift and modify-overwrite-beta for the below input. Please explain how it works with your answer. Input: [ { "data": { "firstName": "Leanne", "lastName": "Graham", "id": 111 } }, { …
3
votes
2 answers

Jolt Spec for masking cards

How can I iterate through list and replace some elements in it? I have this input { "clients": [ { "clientId": "166734", "info": { "cards": [ "378282246310005", "371449635398431" ] } } …
Alice
  • 313
  • 6
  • 11
3
votes
2 answers

Is there a JOLT documentation? What's the meaning of the &, @ etc. operators? (NiFi, JoltTransformJSON)

Yeah there is! I made this question to share my knowledge, Q&A style since I had a hard time finding it myself :) Thanks to https://stackoverflow.com/a/67821482/1561441 (Barbaros Özhan, see comments) for pointing me into the correct direction
DSC
  • 365
  • 3
  • 17
3
votes
1 answer

JSON to JSON using Jolt Spec, split String to array

I need to use jolt transform to do the below JSON transformation. Need to split the "PID3" value in input Json to array of key value pairs in output Json Input JSON { "PID1": "value1", "PID2": "value2", "PID3": "k1^value1~k2^value2~k3^value3" #…
sudheer
  • 33
  • 1
  • 4
3
votes
1 answer

Set null if value is not exists, otherwise return existing value if exists in jolt

As shown in sample input, I have array of extension in each object. When extension doesn't consists subscription-type then output should be null as shown in output or else should consist existing value. Same should be applicable for language-type.…
3
votes
1 answer

Transforming Array of objects with nested array objects using JOLT

I want to transform following input JSON to output JSON format INPUT JSON: [ { "orderNumber": "201904-000000001", "items": [ { "itemPrice": 40000, "itemQuantity": 11, "item": { "external_id":…
Pokuri
  • 3,072
  • 8
  • 31
  • 55
3
votes
2 answers

Jolt Transformation - Lowercase all keys?

I've the following JSON:- { "ROWNUM": "328938", "SOURCE_NAME": "I2323", "ID": "333333", "FIRST_NAME": "A121221", "KNOWN_AS": "G1223321", "LAST_NAME": "sadsadsd", "PLACE_OF_BIRTH": "Indsadsadsaddsaia", "DATE_OF_BIRTH": "sadsaddsa", …
Gavin Gilmour
  • 6,833
  • 4
  • 40
  • 44
3
votes
2 answers

Extracting value from JSON using jolt transformation

I have a JSON object: { "Data": "{field1: [x,y],field2: z}" } Desired Output JSON: { "field3": "z" } [ { "operation": "shift", "spec": { "Data": { "*field2:*}*": { "$(0,2)": "field3" } } } …
Harsh
  • 75
  • 5
3
votes
2 answers

jolt concatenate array elements to single object

I started with Jolt, but I can't concatenate the elements of the array to single string, I have json like this: { "partNb": "1234", "partDescriptions": [ { "country": "GB", "language": "en", "content": "1 tool description…
Marek
  • 31
  • 1
  • 2
3
votes
1 answer

How to perform divide operation in jolt using 'modify-overwrite-beta'

Input, {"scores": [ 4,2,8,7,5 ] } Output, {"FirstElement": 2 } //This is generated by dividing the first element of the array by 2. Spec, [{ "operation": "modify-overwrite-beta", "spec": { "Avg": "=divide(=firstElement(@(1,scores)),2)" …
3
votes
2 answers

JOLT transformation to copy single value along an array

I want to transform a JSON into key-value pairs and simultaneously copy a specific single value, i.e. the "timestamp", to all these pairs. Input JSON: { "Timestamp": "2018-05-13T14:57:09", "first_key": "1023", "another_key": "1987", …
Klaus R.
  • 33
  • 1
  • 4
3
votes
3 answers

How to convert string in json to json object

I have this json string { "team": "xyz", "patern": "abc", "service": "{\"version\":0,\"name\":\"some_service_name\"}", "op": "{\"version\":0,\"name\":\"some_op_name\"}", . . . } and would like to convert it into JsonObject, since it…
Sandeep Raikar
  • 491
  • 1
  • 6
  • 13
3
votes
1 answer

Jolt JSON Conversion from String value to Long

I am using Jolt to convert one json to another json. Everything is working fine except I want to convert String value to Long. Below is my Specs and input. I have use modify-overwrite-beta but no luck. Specs - [ { "operation":…
ppb
  • 2,299
  • 4
  • 43
  • 75
3
votes
1 answer

JoltTransformJSON processor in NiFi(json without any parent tag)

I need to transform a JSON data using the JoltTransformJSON inside Nifi, here's my spec which I am using for the transformation: [{ "operation": "shift", "spec": { "*": { "Header": { "readOn": "created_date_time", …
Ranjan
  • 475
  • 1
  • 5
  • 18
3
votes
1 answer

Map value to a key using JOLT Spec

Is it possible to map a value to a key using JOLT SPEC. MY input Json { "name": "Rj", "Age" : "15" } Output Json as { "Rj" : { "Age":"15" } } Please provide a Json SPEC for above scenario
user6543599
  • 541
  • 2
  • 8
  • 18
1
2
3
87 88