<p>So we are using Loki/Grafana to collect logs from our Kubernetes cluster, and the tool is great for that. But now that I have cleaned up the logs, I would also like to visualize them!</p>
<ol>
<li><p>My logs
<a href="https://i.stack.imgur.com/muDOL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/muDOL.png" alt="enter image description here" /></a></p>
</li>
<li><p>Selecting only JSON lines</p>
<pre><code># My query
{namespace=&quot;default&quot;,pod=~&quot;kkds-dockerscanner-test.+&quot;} |= &quot;SchemaVersion&quot; | json
</code></pre>
<h5>My logs</h5>
<p><a href="https://i.stack.imgur.com/B58jM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B58jM.png" alt="enter image description here" /></a></p>
</li>
<li><p>I select only two columns that I want to display in a table</p>
<pre><code>{namespace=&quot;default&quot;,pod=~&quot;kkds-dockerscanner-test.+&quot;} |= &quot;SchemaVersion&quot; | json | line_format &quot;{{.ArtifactName}} {{.Metadata_OS_Family}}&quot;
</code></pre>
</li>
<li><p>Now I want to show the results in a table, but
Grafana doesn't quite show the table I want. I want to show the output of my query in a table, and not just my output as a string in a column. Do you have any suggestions how to make this work, or can you point to a tutorial?</p>
<p><a href="https://i.stack.imgur.com/SvSMH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SvSMH.png" alt="enter image description here" /></a></p>
</li>
</ol>

Esben Eickhardt
<p>As suggested by @Witt, it is possible to transform the JSON by applying a transformation.</p>
<p>If I choose the <strong>Transform</strong> pane and extract fields, I now get the JSON keys as columns in the Table view.</p>
<p><a href="https://i.stack.imgur.com/dcNXq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dcNXq.png" alt="enter image description here" /></a></p>
<p>Under your datasource, you can also add the columns using <strong>Derived Fields</strong> and <strong>Regex</strong>. This, however, is a bit more cumbersome.</p>
<p><a href="https://i.stack.imgur.com/TsBmd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TsBmd.png" alt="enter image description here" /></a></p>
