在 Fluentd 问题中过滤

Filtering in Fluentd issue

我正在通过负载均衡器接收数据到我的 Kafka 集群(3 个节点)。 除了我需要的 nginx 日志消息,负载均衡器还向我发送某种 ping 以查看 kafka 节点是否仍然存在。 这些 'pings' 在我的 Kafka 主题中显示为:

{"message":"A10\u0000"}

我一直试图在 fluentd 配置文件中过滤掉这些消息,但似乎我无法正确处理。

这是我的 fluentd 配置(的一部分):

<source>
  @type udp
  <parse>
    @type none
  </parse>
  port 11514
  bind 0.0.0.0
  tag trb-login
</source>

<filter A10>
  @type grep
  @log_level debug
  <exclude>
    key message
    pattern A10
  </exclude>
</filter>

还尝试了其他几种模式正则表达式,例如 ^A10、^A10$、^A10*。 甚至尝试了模式的全文 (A10\u0000),其中包含不同数量的反斜杠。 没有什么可以让我过滤掉这一行...... (顺便说一句:@log_level 调试也什么都不做....)

我的 fluentd 版本是 1.2.2

我在这里使用的车辆是否正确(过滤器)? 还是我应该使用解析器? 有什么想法吗?

尝试以下配置。

  <filter>
    @type grep
    <exclude>
      key message
      pattern /^A10/
    </exclude>
  </filter>