简体   繁体   English

是否可以将日志从 ubuntu 发送到 Loki?

[英]Is it possible to send logs from a ubuntu to Loki?

We are using Azure DevOps to run various pipelines, and I would like to send these logs to a Loki instance.我们正在使用 Azure DevOps 运行各种管道,我想将这些日志发送到 Loki 实例。 It is possible simply to send all STDOUT from an Ubuntu machine to Loki?是否可以简单地将所有 STDOUT 从 Ubuntu 机器发送到 Loki?

No, but you can use the "Promtail" to do this.不,但您可以使用“Promtail”来执行此操作。

See more info about the Promtail at the Loki documentation here .此处的 Loki 文档中查看有关 Promtail 的更多信息。

Promtail is released with the Loki releases here . Promtail在此处随 Loki 版本一起发布。

I found out that you can use the Azure DevOps REST API to download your pipeline logs.我发现您可以使用Azure DevOps REST API下载管道日志。 So we have just gone with writing a small kubernetes-cronjob that downloads the pipeline logs based on date filtering and writes them to the STD out of the container.因此,我们刚刚编写了一个小型 kubernetes-cronjob,它根据日期过滤下载管道日志并将它们从容器中写入 STD。 The logs are then picked up by promtail and passed on to loki.然后这些原木由 promtail 拾取并传递给 loki。

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

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