简体   繁体   English

从 Loki 下载日志

[英]Download Logs from Loki

I have a grafana Loki logs that's in my cluster.我的集群中有一个 grafana Loki 日志。 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.我可以看到我的日志,但目前集群不再使用,我想删除它,但我仍然有一些日志我想提取 Loki 并可能将其存储在我的本地系统或 Azure 上桶。

Is there a way to extract this logs and save locally or azure bucket.有没有办法提取此日志并保存在本地或 Azure 存储桶。 I used loki helm to setup my Loki, promethus any help is appreciated我使用 loki helm 来设置我的 Loki,promethus 任何帮助表示赞赏

You could use logcli to connect to Loki.您可以使用logcli连接到 Loki。 See this documentation .请参阅此文档

Example command:示例命令:

port-forward <my-loki-pod> 3100
logcli query '{ job="foo"}'  --limit=5000 --since=48h -o raw > mylog.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM