<p>For reasons I need to parse a certain value from the <code>kubectl get pods</code> respsonse.</p>
<p>I need the value of <code>status.conditions..status</code> where <code>status.conditions..type==&quot;ContainersReady&quot;</code>.</p>
<p>But I'm struggling with the required <code>jsonpath</code> query.</p>
<p>I can retrieve the structure as follows:</p>
<p><code>-o jsonpath='{range @.status.conditions}{@}{end}{&quot;\n&quot;}' | jq</code>:</p>
<pre class="lang-json prettyprint-override"><code>[
  {
    &quot;lastProbeTime&quot;: null,
    &quot;lastTransitionTime&quot;: &quot;2023-10-02T10:45:42Z&quot;,
    &quot;status&quot;: &quot;True&quot;,
    &quot;type&quot;: &quot;Initialized&quot;
  },
  {
    &quot;lastProbeTime&quot;: null,
    &quot;lastTransitionTime&quot;: &quot;2023-10-02T10:45:46Z&quot;,
    &quot;status&quot;: &quot;True&quot;,
    &quot;type&quot;: &quot;Ready&quot;
  },
  {
    &quot;lastProbeTime&quot;: null,
    &quot;lastTransitionTime&quot;: &quot;2023-10-02T10:45:46Z&quot;,
    &quot;status&quot;: &quot;True&quot;,
    &quot;type&quot;: &quot;ContainersReady&quot;
  },
  {
    &quot;lastProbeTime&quot;: null,
    &quot;lastTransitionTime&quot;: &quot;2023-10-02T10:45:35Z&quot;,
    &quot;status&quot;: &quot;True&quot;,
    &quot;type&quot;: &quot;PodScheduled&quot;
  }
]
</code></pre>
<p>But when I try something like <code>range .items[?(@.status.conditions..type==&quot;ContainersReady&quot;)]</code>, I don't receive the expected element.</p>
<p>Question: Is is possible to utilize the <code>jsonpath</code> option in the intended way and if so, how should the expression look like?</p>

Kimses
<pre><code>kubectl get pods -o=jsonpath='{.items[*].status.conditions[?(@.type==&quot;ContainersReady&quot;)].status}'
</code></pre>
