【发布时间】: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