<p>I have a grafana Loki logs that's in my cluster. I am able to see my logs but as at the moment, the cluster is no longer in use and I would like to delete it but I still have some logs I would like to extract Loki and maybe store it locally on my system, or Azure bucket.</p>
<p>Is there a way to extract this logs and save locally or azure bucket. I used loki helm to setup my Loki, promethus any help is appreciated</p>

King
<p>You could use <code>logcli</code> to connect to Loki. See this <a href="https://grafana.com/docs/loki/latest/getting-started/logcli/" rel="noreferrer">documentation</a>.</p>
<p>Example command:</p>
<pre><code>port-forward &lt;my-loki-pod&gt; 3100
logcli query '{ job=&quot;foo&quot;}'  --limit=5000 --since=48h -o raw &gt; mylog.txt
</code></pre>
