0
因此,這裏是我的日誌樣本:自定義神交模式的日誌
23:28:32.226 WARN [MsgParser:ListProc-Q0:I5] Parsing error
Error mapping the fieldAdditional Information:
at com.authentic.mapper.parsing.LengthVar.readBytes(LengthVar.java:178)
at com.authentic.mapper.parsing.GrpLengthVar.read(GrpLengthVar.java:96)
at com.authentic.mapper.parsing.GrpLengthVar.read(GrpLengthVar.java:119)
at com.authentic.mapper.parsing.MsgParser.processReadEnumeration(MsgParser.java:339)
at com.authentic.mapper.parsing.MsgParser.parseIncomingMessageBody(MsgParser.java:295)
at com.authentic.mapper.MapperMgr.parseMsg(MapperMgr.java:1033)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler.parseMessage(AbstractConnectionHandler.java:4408)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler.plainMessageReceivedEvent(AbstractConnectionHandler.java:2031)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler.messageReceivedEvent(AbstractConnectionHandler.java:1911)
at com.authentic.architecture.interchange.accesspoint.SocketConnectionHandler.messageReceivedEvent(SocketConnectionHandler.java:801)
at com.authentic.architecture.interchange.accesspoint.SocketConnectionHandler.messageReceivedEvent(SocketConnectionHandler.java:282)
at com.authentic.architecture.interchange.accesspoint.SocketConnectionHandler.messageReceivedEvent(SocketConnectionHandler.java:261)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler.processEventQueue(AbstractConnectionHandler.java:4110)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler.access$100(AbstractConnectionHandler.java:320)
at com.authentic.architecture.interchange.accesspoint.AbstractConnectionHandler$ConnectionHandlerRunner.execute(AbstractConnectionHandler.java:416)
at com.authentic.architecture.actions.ListProcessor.suspend(ListProcessor.java:1130)
at com.authentic.architecture.actions.ListProcessor.run(ListProcessor.java:775)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NumberFormatException: For input string: "^123"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.authentic.mapper.parsing.LengthVar.readBytes(LengthVar.java:170)
... 17 more
我要解析此登錄到以下字段:時間戳,日誌級別,記錄器,味精,堆棧跟蹤。
我已經使用的多過濾器:
multiline {
pattern => "%{TIME:timestamp}"
negate => true
what => 「previous」
}
和i的神交濾波器所用的模式:
match=>{"message"=>"%{TIME:timestamp} %{LOGLEVEL:loglevel} \s*\[%{DATA:logger}\]\s*%{GREEDYDATA:msg}\n*(?<stacktrace>(.|\r|\n)*)"}
我有http://grokconstructor.appspot.com/do/match檢查它。但爲stacktrace字段得到了這個匹配錯誤。
請提出一些建議。 在此先感謝。
喜@Phonolog請查看我的回答 –
請[編輯](HTTPS: //meta.stackexchange.com/questions/21788/how-does-editing-work)你原來的問題,而不是張貼另一個答案。 – Phonolog
嗨@Phonolog我編輯了相同的,請現在提供一些解決方案。 –