简体   繁体   English

从 Gitlab Runner 保存作业跟踪并重定向到 Graylog

[英]Save job traces from Gitlab Runner and redirect to Graylog

Is that possible to save/redirect Gitlab job traces( like for example this )?是否可以保存/重定向 Gitlab 工作跟踪(例如这个)? My Gitlab runners work in docker containers and I would like to save logs from executed jobs to syslog on the machine, then forward them to Graylog server.我的 Gitlab 跑步者在 docker 容器中工作,我想将已执行作业的日志保存到机器上的 syslog,然后将它们转发到 Graylog 服务器。 I was thinking about some python script catching and redirecting logs, but I don't know how to start and I am not sure if it's a good lead.我在考虑一些 python 脚本捕获和重定向日志,但我不知道如何开始,我不确定这是否是一个好的线索。

I know that job traces are stored on Gitlab Server, but I don't have access to it and need to do this a different way.我知道作业跟踪存储在 Gitlab 服务器上,但我无权访问它,需要以不同的方式执行此操作。

I hope my explanation is understandable, I am new to Gitlab CI.我希望我的解释可以理解,我是 Gitlab CI 的新手。

Job traces aren't ever stored in files on the gitlab runner.作业跟踪从未存储在 gitlab 运行器上的文件中。 They are only transmitted to the GitLab server and there is no option for local log propagation/redirection when using any of the official executors.它们仅传输到 GitLab 服务器,并且在使用任何官方执行程序时没有本地日志传播/重定向选项。

If you don't have direct access to the GitLab server storage, you can use the jobs API to retrieve trace logs from the GitLab server.如果您无法直接访问 GitLab 服务器存储,则可以使用作业 API从 GitLab 服务器检索跟踪日志。 You could then use any normal mechanisms for forwarding those logs to graylog, like a forwarder agent or whatever.然后,您可以使用任何正常机制将这些日志转发到 graylog,例如转发代理或其他。

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

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