【问题标题】:Fluentd - "incoming chunk is broken"Fluentd - “传入的块被破坏”
【发布时间】:2017-06-08 21:51:18
【问题描述】:

我在 docker 容器上运行 fluentd 映像。当我使用 telnet(或 netcat)打开 TCP 连接并发送“消息”字符串时,会出现以下消息:

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=109

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=101

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=115

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=115

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=97

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=103

2017-01-24 10:22:00 +0000 [warn]: incoming chunk is broken: source="host: 192.168.99.1, 
addr: 192.168.99.1, port: 12345" msg=101

我不明白为什么我的“消息”是一个字符一个字符地发送,并在流利的一侧显示为这样。如何整体显示我的“信息”?

另外,当我发送 JSON 格式的字符串时,我仍然收到“传入的块已损坏”警告。我该如何解决这个问题?

【问题讨论】:

标签: logging fluentd


【解决方案1】:

我在使用 fluent-bit 作为客户端时遇到了这个问题,因为发送的内容与预期的格式不匹配。

以下为我解决了(需要为 http 设置两个配置):

fluent-bit.conf

[INPUT]
  name cpu
  tag  cpu.local
  interval_sec 2

[OUTPUT]
  Name  http
  Match *
  Host  12.345.678.9
  Port  1234
  URI   /tagname
  Format json

td-agent.conf

<source>
  @type http
  port 1234
  <parse>
    @type json
  </parse>
</source>

<match tagname>
  @type copy
  <store>
    @type stdout
    @id output_stdout
  </store>
</match>

【讨论】:

    猜你喜欢
    • 2021-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-15
    • 2012-09-02
    • 2018-10-07
    相关资源
    最近更新 更多