<p>I would like to get and see the random number provided by K8s.</p>

<pre><code>kubectl logs abc-abc-platform-xxxxx dicom-server
</code></pre>

<p>Here xxxxx has to be replaced with the random generated number.</p>

<p>Can you let me know which command do I have to execute to find the random number?</p>

<p>If the specific pod has the <code>my-app</code> label, you can find that pod and save it as bash variable:</p>

<ul>
<li><code>POD=$(kubectl get pod -l app=my-app -o jsonpath="{.items[0].metadata.name}")</code></li>
</ul>

<p>and then execute:<br></p>

<ul>
<li><code>kubectl logs $POD</code></li>
</ul>

<p><em>PS. This will work only if you have 1 pod with that specific label.</em></p>
