Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ynlxc opened this issue Sep 16, 2019 · 3 comments
Open

Comments

@ynlxc
Copy link

ynlxc commented Sep 16, 2019

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

@yangsishu
Copy link
Contributor

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

@ynlxc
Copy link
Author

ynlxc commented Sep 16, 2019

配置:
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":"(?[0-9A-B])"}

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

@yangsishu
Copy link
Contributor

yangsishu commented Sep 17, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants