【问题标题】:Which Fluentd plugin I should use to listen application logs : in_tcp or in_forward?我应该使用哪个 Fluentd 插件来监听应用程序日志:in_tcp 还是 in_forward?
【发布时间】:2018-07-12 12:55:29
【问题描述】:

我有 Flask 应用程序,它在localhost:5555 的标准输出中流式传输一些日志。 我想通过 dockerized Fluentd 收听这些日志,但我有点困惑我应该使用哪个插件:in_tcp 还是 in_forward?

这样的配置会导致错误:“地址不可用 - 为 \"my_ip\" 端口 5555 绑定 (2)”

<source>
  @type tcp
  tag "tcp.events"
  format none
  bind my_ip
  port 5555
  log-level debug
</source>

<filter **>
  @type stdout
</filter>

in_forward 的配置示例在配置中始终具有端口 24224,因此它们似乎在侦听其他 fluentd,而不是侦听应用程序。

你能指点一下吗?

【问题讨论】:

  • 您应该使用 @type forward 并将您的日志发送到运行 fluentd 的服务器

标签: docker plugins fluentd


【解决方案1】:

对于接下来的:

使用 fluent-logger-language 将您的日志导出到 Fluentd 服务器。 以下是所有链接: https://github.com/fluent

Fluentd 服务器配置

<source>
  @type forward
  port 24224
  host <if remote>
</source>

<filter **>
  @type stdout
</filter>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-19
    • 1970-01-01
    • 2023-01-16
    • 1970-01-01
    • 2010-09-05
    • 1970-01-01
    • 1970-01-01
    • 2023-02-10
    相关资源
    最近更新 更多