<p>I am trying to select a specific server URL from <code>kubectl config view</code></p>
<pre><code>kubectl config view -o jsonpath='{.clusters[?(@.name == 'dev')].cluster. Server}'
</code></pre>
<p>However, this fails with:</p>
<pre><code> error: error executing jsonpath &quot;{.clusters[?(@.name == dev)].cluster.server}&quot;: Error executing template: unrecognized identifier dev. Printing more information for debugging the template:
            template was:
                    {.clusters[?(@.name == dev)].cluster. Server}
</code></pre>
<p>I tested this with JSONpath.com and it's apparently valid.</p>
<p>What am I doing wrong?</p>
<p><a href="https://i.stack.imgur.com/5zYfd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5zYfd.png" alt="screenshot" /></a></p>

Glue Ops
<p>Change the single quotes around <code>dev</code> to double quotes:</p>
<pre><code>kubectl config view -o jsonpath='{.clusters[?(@.name == &quot;dev&quot;)].cluster.server}'
</code></pre>
<p>You can see an example <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration" rel="nofollow noreferrer">here</a>.</p>
