Parsing 使用mycat多行解析的Fluentbit
我想通过EFK做一个日志管理系统。几天来,我一直在努力让我的多行mycat日志解析器使用fluent bit 我的fluentbit配置:Parsing 使用mycat多行解析的Fluentbit,parsing,
elasticsearch,fluentd,fluent-bit,Parsing,
elasticsearch,Fluentd,Fluent Bit,我想通过EFK做一个日志管理系统。几天来,我一直在努力让我的多行mycat日志解析器使用fluent bit 我的fluentbit配置: parsers.conf: [PARSER] Name mycat_error_log_parser_head Format regex Regex ^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)
parsers.conf:
[PARSER]
Name mycat_error_log_parser_head
Format regex
Regex ^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
[PARSER]
Name mycat_error_log_parser
Format regex
Regex ^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)(\s+)(?<content>(.|\s)*)$
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
fluent-bit.conf
[INPUT]
Name tail
tag mycat
path /var/log/mycat.log
Multiline On
Parser_Firstline mycat_error_log_parser_head
Parser mycat_error_log_parser
Path_Key file
我想我现在已经很接近了,但到目前为止运气不好
在我的kibana。我得到以下结果:
我的多行错误日志丢失。但我在rubular中测试它正常解析
任何帮助都将不胜感激。此配置适用于您的日志文件,Fluent Bit发布了5个文档以使用此配置进行弹性搜索
parsers.conf
[PARSER]
Name mycat_error_log_parser_head
Format regex
Regex ^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)(\s+)(?<content>.*)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
[PARSER]
Name mycat_error_log_parser
Format regex
Regex (?m-ix)^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)(\s+)(?<content>.*)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
fluent-bit.conf
[INPUT]
Name tail
tag mycat
path /var/log/mycat.log
Multiline On
Parser_Firstline mycat_error_log_parser_head
Parser_1 mycat_error_log_parser
Path_Key file
parsers.conf
[语法分析器]
名称mycat\u错误\u日志\u解析器\u头
格式正则表达式
Regex^(?(\d)+(\d+)(\S)+\W(+\S+)(\S+)(请将解析器更改为解析器1
Parser\u Firstline
必须是与除多行异常之外的所有异常匹配的正则表达式
而Parser_1
必须是匹配所有(包括多行异常)的正则表达式。你能解决这个问题吗?我被困在同一个地方。需要注意的是语法分析器在流畅位中。conf
不会在多行开启
模式中使用
parsers.conf
[PARSER]
Name mycat_error_log_parser_head
Format regex
Regex ^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)(\s+)(?<content>.*)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
[PARSER]
Name mycat_error_log_parser
Format regex
Regex (?m-ix)^(?<time>(\d)+(-\d+)+(\S)+\W(\S)+)(\s+)(?<action>\S+)(\s+)(?<on>\S+)(\s+)(?<content>.*)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On
fluent-bit.conf
[INPUT]
Name tail
tag mycat
path /var/log/mycat.log
Multiline On
Parser_Firstline mycat_error_log_parser_head
Parser_1 mycat_error_log_parser
Path_Key file