elasticsearch FileBeat中的多线模式
我使用Filbeat进行日志聚合,它将日志带到Kibana。以下是我的错误消息,需要发送到Kibana:
elasticsearch FileBeat中的多线模式,
elasticsearch,kibana,filebeat,
elasticsearch,Kibana,Filebeat,我使用Filbeat进行日志聚合,它将日志带到Kibana。以下是我的错误消息,需要发送到Kibana: 2017-04-17 15:45:47,154 [JCO.ServerThread-8] ERROR com.webservice.AxisWebServiceClient - Client error 2017-04-17 15:45:47,154 [JCO.ServerThread-8] ERROR com.webservice.AxisWebServiceClient
2017-04-17 15:45:47,154 [JCO.ServerThread-8] ERROR com.webservice.AxisWebServiceClient - Client error
2017-04-17 15:45:47,154 [JCO.ServerThread-8] ERROR com.webservice.AxisWebServiceClient - The XML request is invalid. Fix the request and resend.
310,273,990
310,292,500
360,616,489
2017-04-04 12:47:09,362 [JCO.ServerThread-3] INFO com.app.Listener - End RFC_CALCULATE_TAXES_DOC
2017-04-04 12:47:09,362 [JCO.ServerThread-3] DEBUG com.Time - RFC_CALCULATE_TAXES_DOC,DEC[2],Total Time,39
我只想将2017-04-17 15:45:47154[JCO.ServerThread-8]错误和错误下方的行发送到Kibana,但我也得到了信息部分
下面是filbeat.yml文件
filebeat:
prospectors:
-
paths:
- /apps/global/vertex/SIC_HOME_XEC/logs/sic.log
input_type: log
exclude_lines: ['^INFO']
#include_lines: 'ERROR'
multiline:
pattern: '^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2},\d{3}\s\[[A-Za-z0-9.-]*\]\s[E]RROR'
negate: true
match: after
请求退伍军人帮助使用regex仅选择错误消息模式。为了将错误消息作为一个组提取出来,您需要修改regex,如下所示:
^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2},\d{3}\s\[[A-Za-z0-9.-]*\]\sERROR (\w.+)
说明:
(\w.+)
这将创建一个包含所有字符和点字符的组,用于捕获错误消息。为了将错误消息作为一个组提取出来,您需要修改正则表达式,如下所示:
^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2},\d{3}\s\[[A-Za-z0-9.-]*\]\sERROR (\w.+)
说明:
(\w.+)
这将创建一个包含所有字符和点字符的组,用于捕获错误消息