title: Support for concat in JSON Jolt in Apache NiFi
body: <p>Using Apache NiFi I want to add a new field to all the elements within a JSON flow file based on the concatenation of two other fields. I am trying to use the <code>JoltTransformJSON</code> processor for this, however, the Jolt transform I want to use works OK using online <a href="http://jolt-demo.appspot.com/#inception" rel="nofollow noreferrer">tools</a> but does not work within NiFi. I suspect a version issue but there may be something stupid with my Jolt specification. </p>
  
  <p>The input JSON looks like this...</p>
  
  <pre><code>[
    {
      "id": 485842,
      "cc": 1,
      "x": 0,
      "y": null
    },
    {
      "id": 281733,
      "cc": 1,
      "x": 0,
      "y": 10
    },
    {
      "id": 721412,
      "cc": 12,
      "x": 0,
      "y": null
    }
  ]
  </code></pre>
  
  <p>The desired output I want is this...</p>
  
  <pre><code>[ {
    "id" : 485842,
    "cc" : 1,
    "x" : 0,
    "y" : null,
    "id_cc" : "485842_1"
  }, {
    "id" : 281733,
    "cc" : 1,
    "x" : 0,
    "y" : 10,
    "id_cc" : "281733_1"
  }, {
    "id" : 721412,
    "cc" : 12,
    "x" : 0,
    "y" : null,
    "id_cc" : "721412_12"
  } ]
  </code></pre>
  
  <p>And the Jolt transform I use on the online <a href="http://jolt-demo.appspot.com/#inception" rel="nofollow noreferrer">site</a> is...</p>
  
  <pre><code>[{
    "operation": "modify-default-beta",
    "spec": {
      "*": {
        "id_cc": "=concat(@(1,id),'_',@(1,cc))"
      }
    }
  }]
  </code></pre>
  
  <p>In NiFi, I configure the <code>JoltTransformJSON</code> processor to have <code>Modify-Default</code> and I use this slightly modified Jolt Specification...</p>
  
  <pre><code>{
      "operation": "modify-default",
      "spec": {
        "*": {
          "id_cc": "=concat(@(1,id),'_',@(1,cc))"
        }
      }
  }
  </code></pre>
  
  <p>NiFi validates this OK and the process runs. The output JSON consists of a single record only and a new field is added like this</p>
  
  <pre><code>"operation": "modify-default"
  </code></pre>
  
  <p>Is there a quick fix to the modify-default operation that will resolve this or is there an even easier way using a shift operation?</p>
  
  <p>Thanks in advance for any pointers.</p>