0

I have below input in JSON

{
 "firstName": "Scott",
 "lastName": "Parker"
}

I need in output follow structure

{
  data: {
    "fullName: "Scott Parker"
  }
}

I really don't understand how should work jolt transform processor in nifi

Maybe there are any alternatives in nifi ?

Thanx a lot!!

1 Answers1

0

The example in Jagadesh's link is a good one, the =concat function does exactly what you want (even the field names are the same). Then you just need a shift spec to move the fullName field into the data field and ignore the rest:

[
  {
    "operation": "modify-default-beta",
    "spec": {
      // String join the values in the array x, with a comma and a space
      "fullName": "=concat(@(1,firstName),' ',@(1,lastName))"
    }
  },
  {
    "operation": "shift",
    "spec": {
      "fullName": "data.fullName"
    }
  }
]
mattyb
  • 11,693
  • 15
  • 20