<p>My config map looks like this:</p>

<pre><code>apiVersion: v1
data:
  my-data.yaml |2-
   #data comes here
kind: ConfigMap
</code></pre>

<p>Is it possible to extract the content of <code>my-data.yaml</code> key via </p>

<pre><code>oc get configmap
</code></pre>

<p>or any other <code>oc</code> command?</p>

<p>e.g.</p>

<pre><code>oc get configmap myconfigmap  -o=yaml &lt;[only my-data.yaml]&gt;
</code></pre>

<p>I'd like to demonstrate an example command, which "coderanger" mentioned before.</p>

<p>This example converted from yaml to json and filtered ".keyname" using "jq" command after that.
You can also use "yq" command instead of python one-liner and jq combination.</p>

<pre><code>oc get configmap/myconfigmap \
   -o "jsonpath={ .data['my-data\.yaml']}" | \
   python -c 'import sys, yaml, json; y=yaml.load(sys.stdin.read()); print json.dumps(y)' | \
   jq '. | .keyname'
</code></pre>

<p>I hope it help you.</p>
