logstash-logback-encoder仅发送与某些包相关的日志

时间:2018-05-07 12:30:17

标签: spring-boot elasticsearch logstash logstash-logback-encoder

我正在使用logstash-logback-encoder将日志发送到Elasticsearch。

特别是,我正在使用 LoggingEventCompositeJsonEncoder

我的应用程序日志类似于以下内容:

07/05/18 12:35:01.325 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@49e5f737: startup date [Mon May 07 12:35:01 CEST 2018]; root of context hierarchy

 ... 

07/05/18 12:35:01.932 [main] INFO  o.s.j.e.a.AnnotationMBeanExporter - Registering beans for JMX exposure on startup
07/05/18 12:35:01.950 [main] INFO  it.test.elk.ELKTestApplication - Started ELKTestApplication in 0.956 seconds (JVM running for 1.645)
07/05/18 12:35:01.952 [Thread-6] INFO  o.s.c.a.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@49e5f737: startup date [Mon May 07 12:35:01 CEST 2018]; root of context hierarchy
07/05/18 12:35:01.955 [Thread-6] INFO  o.s.j.e.a.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown

我只想将与 it.test.elk。相关的日志发送到elasticsearch。

你能用grok做吗? 或者我是否必须专门配置logback.log?

0 个答案:

没有答案