我想弄清楚下面日誌文件的grok模式。它包含1行成功日誌和1條警告日誌。如何爲此日誌文件編寫grok
2016-09-03T12:53:31-04:00 DEV SampleFileService INFO 512132:414618:SampleFileService-2-FTS EXECUTING: Error Handling Client Request started
2016-09-03T12:53:31-04:00 DEV SampleFileService WARNING 512133:414618:SampleFileService-2-FTS ERROR: Error while sending ErrorHandler request to IEHS Queue: test.queue.publish
Retry count 1 of 3,
Error:
<ns0:ErrorReport xmlns:ns0="http://www.tibco.com/pe/EngineTypes">
<StackTrace>Job-414618 Error in [Process-Path!!]
There was an unexpected error while sending a message.
at com.tibco.plugin.share.jms.impl.JMSSender.send(Unknown Source)
at com.tibco.plugin.share.jms.impl.JMSSender.send(Unknown Source)
at com.tibco.plugin.jms.JMSAbstractTransmitActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
at com.tibco.pe.core.Job.a(Unknown Source)
at com.tibco.pe.core.Job.k(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
caused by: com.tibco.plugin.share.jms.impl.JMSExceptionWrapper: javax.jms.JMSException: Failure storing message
at com.tibco.plugin.share.jms.impl.JMSPluginException.<init>(Unknown Source)
at com.tibco.plugin.share.jms.impl.JMSSender.send(Unknown Source)
at com.tibco.plugin.share.jms.impl.JMSSender.send(Unknown Source)
at com.tibco.plugin.jms.JMSAbstractTransmitActivity.eval(Unknown Source)
at com.tibco.pe.plugin.Activity.eval(Unknown Source)
at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
at com.tibco.pe.core.Job.a(Unknown Source)
at com.tibco.pe.core.Job.k(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
Caused by: javax.jms.JMSException: Failure storing message
at com.tibco.tibjms.Tibjmsx.buildException(Tibjmsx.java:612)
at com.tibco.tibjms.TibjmsxSessionImp._publish(TibjmsxSessionImp.java:1544)
at com.tibco.tibjms.TibjmsMessageProducer._publish(TibjmsMessageProducer.java:246)
at com.tibco.tibjms.TibjmsQueueSender.send(TibjmsQueueSender.java:74)
... 9 more
</StackTrace>
<Msg>There was an unexpected error while sending a message.</Msg>
<FullClass>com.tibco.plugin.share.jms.impl.JMSPluginException</FullClass>
<Class>JMSPluginException</Class>
<ProcessStack>Stack-Path!!</ProcessStack>
<MsgCode>BW-JMS-100039</MsgCode>
</ns0:ErrorReport>
你說明你想從你的日誌中提取什麼?因爲如果沒有要檢索的信息,grok過濾器就沒用了。 – baudsp
也可以幫助你:[grok filter tester](http://grokconstructor.appspot.com/do/match#result),[grok filter documentation](https://www.elastic.co/guide/en/logstash /current/plugins-filters-grok.html)和[Grok模式](https://github.com/logstash-plugins/logstash-patterns-core/blob/master/patterns/grok-patterns)。 – baudsp
考慮到第一行,應該是 timestamp - > 2016-09-03T12:53:31-04:00, Env - > Dev,Application - > SampleFileService, Level - > Info, Thread - > 512132: 414618:SampleFileService-2-FTS, 狀態 - > EXECUTING, 消息 - >(消息的提醒) 第二行有更多信息記錄在字段'Message'中。 –