【问题标题】:Filtering out container logs from jorunald using fluentd使用 fluentd 从 jorunald 中过滤掉容器日志
【发布时间】:2019-04-04 10:32:46
【问题描述】:

我有大约 30 个 docker 容器,它们使用标签“container_name”将日志写入日志。我正在使用 google-fluentd 将日志发送到 Google Stackdriver。我发现很难使用 journald 中给出的标签对日志进行分类。

google-fluentd.conf 中,我尝试将日志一一标记到 Stackdriver,如下所示。

<source>
  @type systemd
  filters [{ "_SYSTEMD_UNIT": "test.service" }]
  <storage>
    @type local
    persistent true
    path /var/run/google-fluentd/test.service.pos
  </storage>
  read_from_head true
  tag test.service
</source>

这可行,但如果服务数量增加,我将不得不一次包含一个块。如果不这样做,是否有一种简单的方法可以从标签中的日志中获取容器日志并写入 Stackdriver?

【问题讨论】:

    标签: docker logging fluentd stackdriver systemd-journald


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多