I want to match a syslog string and match into corresponding fields. Here is the message in question:
Jul 06 2018 08:04:18: %ASA-6-305011: Built dynamic UDP translation from any:123.123.123.123/35439 to OUTSIDE-VRF180:123.123.123.123/35439
Jul 6 00:00:02 172.28.51.197 %ASA-6-302016: Teardown UDP connection 22180105 for INSIDE-VRF4100:123.123.123.123/21588 to SDN-VRF110:123.123.123.123/902 duration 0:02:01 bytes 66
The grok filter i'm running against this is the following:
grok {
match => ["message", "%{SYSLOGHOST:ciscotag}%{GREEDYDATA:cisco_message}"]
}
However, so the problem is that not all messages have timestamp and therefore i cannot match on the timestamp first. What i would like is a filter that could correctly parse each syslog message if the message contains a timestamp and also match correctly if does not contain a timestamp. Sort of like an "or" statement i think?
On the grokconstructor website it successfully matches but when i try it in logstash i get some of the timestamp in "ciscotag" for example. So the match fails and it gets tagged "_grokparsefailure".
On the grokconstructor website it successfully matches but when i try it in logstash i get some of the timestamp in "ciscotag" for example. So the match fails and it gets tagged "_grokparsefailure".
What does that event look like? Use a stdout { codec => rubydebug } output to dump the raw event.
I've figured out the root cause of the error. The firewall in question which are generating the events which causes a _grokparsefailure is a ASA firepower with the SFR module. The logs from it looks either like this:
SFR requested to drop TCP packet from OUTSIDE-VRF180:123.123.123.123/80 to INSIDE-VRF4100:123.123.123.123/6532
or like this:
SFR requested ASA to bypass further packet redirection and process TCP flow from INSIDE-VRF4100:123.123.123.123/57301 to OUTSIDE-VRF180:123.123.123.123/443 locally
And if i'm not mistaken, logstash has no support for this? So i would have to right my own grok filter?
Because i want to have similiar functionality that the supported cisco patterns implement, like "action" "src_ip" "src_port" etc.
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.