Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Grok解析不报错, 但是有些字段拿不到值 #28

Closed
childe opened this issue Dec 6, 2016 · 3 comments
Closed

Grok解析不报错, 但是有些字段拿不到值 #28

childe opened this issue Dec 6, 2016 · 3 comments
Assignees
Labels

Comments

@childe
Copy link
Owner

childe commented Dec 6, 2016

^%{SYSLOGTIMESTAMP:logtime} %{IP:device_ip} %{DATE}:%{TIME} %{WORD} %{WORD:device_ci} %{DATA:message}$

如果中间有 %{DATE} 或者其它一些预定义Pattern, 后面的字段取不到值.

@childe childe self-assigned this Dec 6, 2016
@childe childe added the bug label Dec 6, 2016
@childe
Copy link
Owner Author

childe commented Dec 6, 2016

暂时的解决方案是
改成 (?:%{DATE}:%{TIME})

@githubnovee
Copy link

githubnovee commented Oct 10, 2017

abc|xxx|20171010|tt|5.82.001
abc|xxx|20171010|tt|5.82.002|dd

有多行不统一字段,这种5.82.001,5.82.002怎么用grok匹配,好像这样匹配version为空
'^%{DATA:t1}|%{DATA:t2}|%{DATA:t3}|%{DATA:t4}|%{DATA:version}'

@childe
Copy link
Owner Author

childe commented Oct 12, 2017

^%{DATA:t1}\|%{DATA:t2}\|%{DATA:t3}\|%{DATA:t4}\|%{DATA:version}(\||$)

这个是纯正则问题, 建议新开issue

@childe childe closed this as completed Oct 12, 2017
@childe childe reopened this Oct 12, 2017
@childe childe closed this as completed Dec 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants