I run filebeat and filebeat run each line from log to logstash, and I have each grok for each line message. But why grok not sending the second data (different field) to Elasticsearch..
This bellow my configuration :
logstash-fileter.conf :
input { stdin { } }
filter {
if [message] =~ "SSH login" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:lfd.time} %{HOSTNAME:lfd.host} %{WORD:lfd.app}\[%{NUMBER:lfd.pid}\]\: \*%{DATA:lfd.act}\* from %{IP:lfd.ip} into the %{WORD:lfd.user} account using %{DATA:lfd.method} \- %{WORD:lfd.status}" }
}
} else if [message] =~ "Blocked" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:lfd.time} %{HOSTNAME:lfd.host} %{WORD:lfd.app}\[%{NUMBER:lfd.pid}\]: \(%{WORD:lfd.act.app}\) %{DATA:lfd.act.desc} from %{IP:lfd.ip} %{DATA:lfd.path.source}: %{DATA:lfd.reason} - %{DATA:lfd.act.blocked} \[%{DATA:lfd.rule}\]" }
}
} else {
drop {}
}
}
output {
elasticsearch { hosts => ["112.78.176.26:9200"] }
stdout { codec => rubydebug }
}
mylog :
May 27 23:31:01 web1-cpn lfd[3023828]: (cpanel) Failed cPanel login from 185.94.188.23 (NL/Netherlands/-): 60 in the last 60 secs - Blocked in csf [LF_CPANEL]
[root@server1 ~]# cat lfd.log | grep Blocked -A3
May 27 23:31:01 web1-cpn lfd[3023828]: (cpanel) Failed cPanel login from 185.94.188.23 (NL/Netherlands/-): 60 in the last 60 secs - Blocked in csf [LF_CPANEL]
May 27 23:31:50 web1-cpn lfd[2324927]: SSH login from 117.102.98.28 into the root account using publickey authentication - ignored
May 27 23:31:50 web1-cpn lfd[2324927]: SSH login from 117.102.98.28 into the root account using publickey authentication - ignored
please advice,, why there is not sending the second data to elasticsearch?
It only show the first line/message data has been parsed to kibana? and the second line/message not shown?
whether it can be due to differences in the field that I give in each groks?
please help the solution for this issue?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.