filebeat 的source值为
/opt/apache-tomcat-7.0.52-20000-api/logs/catalina-2018-12-05.out
.
用
%{GREEDYDATA:sth1}-%{YEAR}-%{MONTHNUM}-%{MONTHDAY}%{GREEDYDATA:sth2}
能grok了,但放在logstash filter
grok {
match => {
"source" => "%{GREEDYDATA:sth1}-%{YEAR}-%{MONTHNUM}-%{MONTHDAY}%{GREEDYDATA:sth2}"
}
}
却取不出值?
/opt/apache-tomcat-7.0.52-20000-api/logs/catalina-2018-12-05.out
.
用
%{GREEDYDATA:sth1}-%{YEAR}-%{MONTHNUM}-%{MONTHDAY}%{GREEDYDATA:sth2}
能grok了,但放在logstash filter
grok {
match => {
"source" => "%{GREEDYDATA:sth1}-%{YEAR}-%{MONTHNUM}-%{MONTHDAY}%{GREEDYDATA:sth2}"
}
}
却取不出值?
2 个回复
medcl - 今晚打老虎。
赞同来自:
取不出来是 grok 执行失败还是没有读到日志?
wangduoduo
赞同来自:
mapping => {
"source" => "/%{ts}/%{+ts}/%{+ts}/%{name}"
}
}
目的是为了读取source 的值 /home/log/2020-10-23/10.11.5.1.log
通过这样写仍然读取不处理 source 的值,麻烦提示下