you’ll need to add jolt spec to transform the source json format to the desired json format

Check this spec,

[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "@": "&",
        // Shift all the DE nodes to a same named node.
        // Here it is moved as TMPDE
        "payload": {
          "DE|DE61": "&2.payload.TMPDE"
        }
      }
    }
  }, {
    "operation": "modify-default-beta",
    "spec": {
      "*": {
        "payload": {
          "DE61SF1": "=substring(@(1,TMPDE), 2, 4)",
          "DE61SF2": "=substring(@(1,TMPDE), 5, 14)",
          "DE61SF3": "=substring(@(1,TMPDE), 14, 21)"
        }
      }
    }
  }, {
    "operation": "shift",
    "spec": {
      "*": {
        "correlationId": "[&1].payload.correlationId",
        "payloadFormat": "[&1].payload.payloadFormat",
        "payload": {
          "DE61SF1": "[&2].payload.DE61SF1",
          "DE61SF2": "[&2].payload.DE61SF2",
          "DE61SF3": "[&2].payload.DE61SF3",
          "location": "[&2].payload.location",
          "pop": "[&2].payload.pop",
          "name": "[&2].payload.name"
        }
      }
    }
  }
]

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top