I am new to ELK and I'm having issues with Grok. I'm trying to parse logs that look similar to this:
"message" => "<188>362233: Jan 3 15:17:27: %IGMP_QUERIER-4-ZERO_SRC_IP_ADDR: An IGMP General Query packet with source IP address that contained all zeroes is received in VLAN 1 on port Gi2/0/52.",
This is from a Cisco switch. I would like to pull the <188> and 362233 as well as the date and time out of the message but I'm not sure how to do it. I tried Grok and I think I made it match (how can I confirm?) the <188> part using %BASE10NUM:syslog_pri filter but it was still in the message part even though it did make a new tag called syslog_pri.
Also, where can I find documentation on what the built in regex filters actually do? I'm not very good with regex so I need a little explanation (I did find the actual expressions on github).
And what's the result of the stdout { codec => rubydebug } output?
"message" => "<188>362403: Jan 3 18:06:12: %IGMP_QUERIER-4-ZERO_SRC_IP_ADDR: An IGMP General Query packet with source IP address that contained all zeroes is received in VLAN 1 on port Gi2/0/52.",
"@version" => "1",
"@timestamp" => "2017-01-03T23:06:13.834Z",
"host" => "10.93.1.2",
"tags" => [
[0] "_grokparsefailure"
],
"syslog_severity_code" => 5,
"syslog_facility_code" => 1,
"syslog_facility" => "user-level",
"syslog_severity" => "notice"
My last question is now that I've got the tags working now do I remove the content from the message?
Would I use mutate for this? Also, what is the purpose of matching data but not tagging it? What I mean is what does adding %{SYSLOGTIMESTAMP}: %{GREEDYDATA} without the :tag part do?
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.