title: Moving a key down into a array in NIFI using JOLT
body: <p>this is my first post. I need to transform a JSON using JOLT in NIFI.
  To process it further, I need to move (or copy) the key of each array INTO the array itself.</p>
  <p>The JSON is looking like this (simplified, number of elements in the arrays is variable)</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;status&quot;: {
      &quot;123&quot;: {
        &quot;key1&quot;: &quot;value1&quot;,
        &quot;key2&quot;: &quot;value2&quot;,
        &quot;key3&quot;: &quot;value3&quot;,
        &quot;key4&quot;: &quot;value4&quot;,
        &quot;key5&quot;: &quot;value5&quot;,
        &quot;key6&quot;: &quot;value6&quot;,
        &quot;key7&quot;: &quot;value7&quot;
      },
      &quot;345&quot;: {
        &quot;key1&quot;: &quot;value1&quot;,
        &quot;key2&quot;: &quot;value2&quot;,
        &quot;key3&quot;: &quot;value3&quot;,
        &quot;key4&quot;: &quot;value4&quot;,
        &quot;key5&quot;: &quot;value5&quot;,
        &quot;key6&quot;: &quot;value6&quot;,
        &quot;key7&quot;: &quot;value7&quot;
      }
    }
  }
  </code></pre>
  <p>I need to have the key of each array being a member of it, so my desired output would be</p>
  <pre><code>{
    &quot;status&quot;: {
      &quot;123&quot;: {
        &quot;id&quot;  : &quot;123&quot;
        &quot;key1&quot;: &quot;value1&quot;,
        &quot;key2&quot;: &quot;value2&quot;,
        &quot;key3&quot;: &quot;value3&quot;,
        &quot;key4&quot;: &quot;value4&quot;,
        &quot;key5&quot;: &quot;value5&quot;,
        &quot;key6&quot;: &quot;value6&quot;,
        &quot;key7&quot;: &quot;value7&quot;
      },
      &quot;345&quot;: {
        &quot;id&quot;  : &quot;345&quot;,
        &quot;key1&quot;: &quot;value1&quot;,
        &quot;key2&quot;: &quot;value2&quot;,
        &quot;key3&quot;: &quot;value3&quot;,
        &quot;key4&quot;: &quot;value4&quot;,
        &quot;key5&quot;: &quot;value5&quot;,
        &quot;key6&quot;: &quot;value6&quot;,
        &quot;key7&quot;: &quot;value7&quot;
      }
    }
  }
  </code></pre>
  <p>But so far, I wasn't able to solve this. All examples I found were moving a parent value into the array, but never the key of the array itself.</p>
  <p>Please help</p>
  <p>BR</p>
  <p>Kai</p>