这是我的日志文件。
Application-log-sample.log
2017-01-03 05:40:49.693 INFO main --- com.getsentry.raven.DefaultRavenFactory : Using an HTTP connection to Sentry.
2017-01-03 05:40:49.935 INFO background-preinit --- org.hibernate.validator.internal.util.Version : HV000001: Hibernate Validator 5.2.4.Final
我越来越迷惑了神交模式。你能不能有人请提出好的建议。
一个简单的模式可以是:
^%{TIMESTAMP_ISO8601:event_time}\s+%{LOGLEVEL:level}\s+%{SYSLOGPROG}\s---\s%{JAVACLASS:class}\s+:\s+%{GREEDYDATA:message}$
使用https://grokdebug.herokuapp.com/建立自己的模式和http://grokconstructor.appspot.com/do/match测试它在许多行。
您还可以配置神交检查多个模式(停在第一个匹配),并用自己的方式,看到reference。