jlogstash icon indicating copy to clipboard operation
jlogstash copied to clipboard

6.0.1版Jlogstash, 执行JlogstashMain不会触发filter grok规则。

Open ynlxc opened this issue 6 years ago • 3 comments

求发一个可以根据grok 正则表达式正确解析并输出日志文件的配置文件例子

ynlxc avatar Sep 16 '19 14:09 ynlxc

你把的你的fliter的jgrok的配置发下

yangsishu avatar Sep 16 '19 14:09 yangsishu

配置: inputs:

  • File: path: - /Users/zxm/IdeaProjects/jlogstash-6.0.1/test/airport2.2019-09-12.8.log outputs:
  • Kafka: topic: test_jlogstash compressionCodec: none brokerList: localhost:9092 filters:
  • JGrok: srcs: ["ip"] patterns: {"ip":"(?<fromApp>[0-9A-B])"}

测试json: [192.168.0.1] [ERROR c.c.s.port.passenger.FlowServiceImpl - 删除人流统计失败]

ynlxc avatar Sep 16 '19 14:09 ynlxc

{"ip":"(?<fromApp>[0-9A-B.])"},都是标准的正则语法,grok也只是基于正则做了层封装;这个你到网上搜下找个demo

yangsishu avatar Sep 17 '19 10:09 yangsishu