title: Selectively get certain arrays from inside an array in JSON using JOLT
body: <p>I've been trying to get some fields out of a very long and complicated json format but not getting the output I want.</p>
  <p>MY current spec obtains all events from the event array and lists them in the output. I'm unsure how to select specific events and only output those. Am not quite sure of the syntax</p>
  <p>My JSON:</p>
  <pre><code>{
    &quot;rootid&quot;: &quot;19718&quot;,
    &quot;clloadm&quot;: &quot;2021-06-01T22:40:02&quot;,
    &quot;clload&quot;: &quot;2021-06-01T21:21:39&quot;,
    &quot;date&quot;: &quot;2021-05-25T21:52:30&quot;,
    &quot;events&quot;: [
      {
        &quot;done&quot;: {
          &quot;id&quot;: &quot;e0&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;id&quot;: &quot;e0_event&quot;,
        &quot;started&quot;: {
          &quot;id&quot;: &quot;e0&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;status&quot;: &quot;complete&quot;
      },
      {
        &quot;done&quot;: {
          &quot;id&quot;: &quot;e1&quot;,
          &quot;value&quot;: &quot;2021-05-27T02:20:25&quot;
        },
        &quot;id&quot;: &quot;e1_event&quot;,
        &quot;started&quot;: {
          &quot;id&quot;: &quot;e1&quot;,
          &quot;value&quot;: &quot;2021-05-27T02:20:25&quot;
        },
        &quot;status&quot;: &quot;complete&quot;
      },
      {
        &quot;done&quot;: {
          &quot;id&quot;: &quot;e2&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;id&quot;: &quot;e2_event&quot;,
        &quot;started&quot;: {
          &quot;id&quot;: &quot;e2&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;status&quot;: &quot;complete&quot;
      },
      {
        &quot;done&quot;: {
          &quot;id&quot;: &quot;e3&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;id&quot;: &quot;e3_event&quot;,
        &quot;started&quot;: {
          &quot;id&quot;: &quot;e3&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;status&quot;: &quot;complete&quot;
      },
      {
        &quot;done&quot;: {
          &quot;id&quot;: &quot;e4&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;id&quot;: &quot;e4_event&quot;,
        &quot;started&quot;: {
          &quot;id&quot;: &quot;e4&quot;,
          &quot;value&quot;: &quot;2021-05-29T08:08:19&quot;
        },
        &quot;status&quot;: &quot;complete&quot;
      }
    ],
    &quot;ids&quot;: [
      {
        &quot;id&quot;: &quot;id&quot;,
        &quot;source&quot;: &quot;source&quot;,
        &quot;value&quot;: &quot;value&quot;
      },
      {
        &quot;id&quot;: &quot;new_id&quot;,
        &quot;source&quot;: &quot;new_source&quot;,
        &quot;value&quot;: &quot;value&quot;
      }
    ]
  }
  </code></pre>
  <p>My Jolt Spec that gets all events for now:</p>
  <pre class="lang-json prettyprint-override"><code>[
    {
      &quot;operation&quot;: &quot;shift&quot;,
      &quot;spec&quot;: {
        &quot;rootid&quot;: &quot;rootid&quot;,
        &quot;clloadm&quot;: &quot;clloadm&quot;,
        &quot;clload&quot;: &quot;clload&quot;,
        &quot;date&quot;: &quot;date&quot;,
        &quot;events&quot;: {
          &quot;*&quot;: {
            &quot;*&quot;: {
              &quot;@value&quot;: &quot;@id&quot;
            }
          }
        },
        &quot;ids&quot;: {
          &quot;*&quot;: {
            &quot;@value&quot;: &quot;@id&quot;
          }
        }
      }
    }
  ]
  </code></pre>
  <p>The output I get:</p>
  <pre><code>{
    &quot;rootid&quot; : &quot;19718&quot;,
    &quot;clloadm&quot; : &quot;2021-06-01T22:40:02&quot;,
    &quot;clload&quot; : &quot;2021-06-01T21:21:39&quot;,
    &quot;date&quot; : &quot;2021-05-25T21:52:30&quot;,
    &quot;e0&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;e1&quot; : [ &quot;2021-05-27T02:20:25&quot;, &quot;2021-05-27T02:20:25&quot; ],
    &quot;e2&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;e3&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;e4&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;id&quot; : &quot;value&quot;,
    &quot;new_id&quot; : &quot;value&quot;
  }
  </code></pre>
  <p>The output I would like</p>
  <pre><code>{
    &quot;rootid&quot; : &quot;19718&quot;,
    &quot;clloadm&quot; : &quot;2021-06-01T22:40:02&quot;,
    &quot;clload&quot; : &quot;2021-06-01T21:21:39&quot;,
    &quot;date&quot; : &quot;2021-05-25T21:52:30&quot;,
    &quot;e0&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;e4&quot; : [ &quot;2021-05-29T08:08:19&quot;, &quot;2021-05-29T08:08:19&quot; ],
    &quot;id&quot; : &quot;value&quot;,
    &quot;new_id&quot; : &quot;value&quot;
  }
  
  </code></pre>