【问题标题】:Fluent-bit unable to find parser event if define in config file如果在配置文件中定义,Fluent-bit 无法找到解析器事件
【发布时间】:2020-07-27 07:18:46
【问题描述】:

我想在 fluent-bit 中创建一个解析器来解析日志,这些日志被发送到 elastic search 实例,但过滤器无法选择解析器,即使它已创建。

这里是日志:

Fluent Bit v1.0.4
Copyright (C) Treasure Data
[2020/07/27 07:06:03] [ info] [storage] initializing...
[2020/07/27 07:06:03] [ info] [storage] in-memory
[2020/07/27 07:06:03] [ info] [storage] normal synchronization mode, checksum disabled
[2020/07/27 07:06:03] [ info] [engine] started (pid=1)
[2020/07/27 07:06:03] [ info] [filter_kube] https=1 host=kubernetes.default.svc port=443
[2020/07/27 07:06:03] [ info] [filter_kube] local POD info OK
[2020/07/27 07:06:03] [ info] [filter_kube] testing connectivity with API server...
[2020/07/27 07:06:03] [ info] [filter_kube] API server connectivity OK
[2020/07/27 07:06:03] [error] [filter_parser] requested parser 'simple_json_with_time' not found
[2020/07/27 07:06:03] [error] [filter_parser] Invalid "parser"
[2020/07/27 07:06:03] [error] Failed initialize filter parser.1

解析器:

            Name        simple_json_with_time
            Format      json
            Time_Key    time
            Time_Format %Y-%m-%d %H:%M:%S,%L
            Time_Keep   On
            Decode_Field_As   escaped_utf8    log    do_next
            Decode_Field_As   json       log
   

过滤器:

            Name                parser
            Match               core-test*
            Parser              simple_json_with_time
            Key_Name            log
            Reserve_Data        On
            Preserve_Key        On

不知道为什么它没有选择解析器,谁能帮我解决上述错误?

【问题讨论】:

  • 您能否将时间格式更改为 %Y-%m-%d %H:%M:%S.%L 。将 ,(comma) 替换为 .(dot) 并尝试,因为您的解析器似乎无效。
  • 您是否包含了解析器文件?

标签: logging kubernetes devops fluent-bit


【解决方案1】:

你用的是什么版本的fluentbit,让我们检查一些相关的问题。

在我删除 fluentbit 中定义的自定义解析器 mongodb 后,问题解决了

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
猜你喜欢
  • 2020-11-08
  • 1970-01-01
  • 1970-01-01
  • 2019-03-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-12
相关资源
最近更新 更多