fluentd 配置以获取 jenkins docker 日志

时间:2021-03-08 04:10:32

标签: jenkins fluentd fluent-docker

我有一个 jenkins pod,它以这种格式发出日志:

2021-03-07 10:38:23.873+0000 [id=9370]  INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Fingerprint cleanup. 3 ms
2021-03-07 17:56:02.812+0000 [id=9857]  INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started Download metadata
2021-03-07 17:56:02.820+0000 [id=9857]  INFO    hudson.util.Retrier#start: Attempt #1 to do the action check updates server
2021-03-07 17:56:13.405+0000 [id=9857]  INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Maven.MavenInstaller
2021-03-07 17:56:13.678+0000 [id=9857]  INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tasks.Ant.AntInstaller
2021-03-07 17:56:14.188+0000 [id=9857]  INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.plugins.gradle.GradleInstaller
2021-03-07 17:56:15.458+0000 [id=9857]  INFO    h.m.DownloadService$Downloadable#load: Obtained the updated data file for hudson.tools.JDKInstaller
2021-03-07 17:56:15.459+0000 [id=9857]  INFO    hudson.util.Retrier#start: Performed the action check updates server successfully at the attempt #1
2021-03-07 17:56:15.461+0000 [id=9857]  INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished Download metadata. 12,643 ms
2021-03-07 20:59:17.933+0000 [id=10070] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Started telemetry collection
2021-03-07 20:59:17.947+0000 [id=10070] INFO    hudson.model.AsyncPeriodicWork#lambda$doRun$0: Finished telemetry collection. 4 ms

我正在努力使用流畅的转发器配置来获取此日志。

 <source>
      @type tail
      path /var/log/containers/jenkins*.log
      pos_file /opt/bitnami/fluentd/logs/buffers/fluentd-jenkins.log.pos
      tag jenkins
      **< Qn: How should I be writing the log parser statement>**
      read_from_head true
  </source>

感谢帮助。

0 个答案:

没有答案
相关问题