Hello together,
I want to log different topics from my router, giving me dynamic logs like
Apr/25/2018 07:19:37 ipsec,debug,packet 852310ad 5ebd8ba7 5ee02726 b0f1e739 6dafe48d 6c2f812f
Apr/25/2018 07:19:37 ipsec,debug encrypted payload by IV
Apr/25/2018 08:01:11 system,info,account user admin logged out from 192.168.88.1 via telnet
As you can see, the topic-information after the timestamp, could not be set static because depending on the topic, there could be one or more topics, all seperated through a comma.
Because I don´t want to set one filter per possible log-topic I want you to ask, if theres any filter-possibility where I can split this log in timestamp, topic1, topic,2, topic3,... and message
if [type] == "Router1" {
grok {
match => {"message" => "%{WORD:TOPIC1},%{WORD:TOPIC2},%{WORD:TOPIC3} {GREEDYDATA:MESSAGE}"}
}
}
}
So far it works fine as long as there are exactly three topics. Otherwise I get the _grokparsefailure and my log is not split correctly. How should I adjust my filter-config?
Thanks a lot, that was the pattern I was looking for. I noticed seperating the topics wouldn´t make sense because the sequence of topics chanches. Searching with kibana is easier with the simple filter:
filter {
if [type] == "MikroTik" {
grok {
match => {"message" => "%{NOTSPACE:TOPIC} %{GREEDYDATA:MESSAGE}"}
}
}
}
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.