<p>I have a broken pod in default namespace. I want to store associated error events to a file error.txt. I need to use the -o wide output specifier with my command.
I saw command like this</p>
<pre><code>- kubectl get pod termination-demo -o go-template=&quot;{{range
   .status.containerStatuses}}{{.lastState.terminated.message}}{{end}}&quot;
</code></pre>
<p>but i need to use -o wide command.</p>

O.Man
<p>If you want to achieve the pod state :</p>
<pre><code>kubectl get pod -n &lt;NAMESPACE&gt; &lt;POD&gt; --output=wide -o go-template=&quot;{{range.status.containerStatuses}}{{.lastState.terminated.message}}{{end}}&quot; &gt; pod.err
</code></pre>
<p>Verify by :</p>
<pre><code>$ cat pod.err
</code></pre>
