0

The input json :

{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3",
  "key4": "value4"
}

The expected output:

{
  "key1" : "value1",
  "Name" : {
    "key2" : "value2",
    "key3" : "value3",
    "key4" : "value4"
  }
}

I would like to have a jolt transform, which can nest few fields.

1 Answer 1

1

You just need a shift transformation with a conditional logic: picking key1 and the rest of the attributes("*") such as

[
  {
    "operation": "shift",
    "spec": {
      "key1": "&",
      "*": "Name.&"
    }
  }
]

the demo on the site http://jolt-demo.appspot.com/

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.