I used the conf file from here and the pattern below in a pattern file referenced by the conf file.
.conf grok section
grok {
# There are a couple of custom patterns associated with this filter.
patterns_dir => [ "/etc/logstash/conf.d/patterns/ios" ]
match => [
# IOS
"message", "%{SYSLOG5424PRI}(%{NUMBER:log_sequence})?:( %{HOSTNAME:hostname}:)? (%{INT:cisco_seq_num}: )?.?%{CISCOTIMESTAMPTZ:log_date}: %%{CISCO_REASON:facility}-%{INT:severity_level}-%{CISCO_REASON:facility_mnemonic}: ( )?%{GREEDYDATA:message}",
"message", "%{SYSLOG5424PRI}(%{NUMBER:log_sequence})?:( %{HOSTNAME:hostname}:)? (%{INT:cisco_seq_num}: )?.?%{CISCOTIMESTAMPTZ:log_date}: %%{CISCO_REASON:facility}-%{CISCO_REASON:facility_sub}-%{INT:severity_level}-%{CISCO_REASON:facility_mnemonic}: ( )?%{GREEDYDATA:message}"
]
overwrite => [ "message" ]
add_tag => [ "ciscoios" ]
remove_field => [ "syslog5424_pri", "@version" ]
}
}
pattern file /etc/logstash/conf.d/patterns/ios/patterns-ios:
CISCOTIMESTAMPTZ %{CISCOTIMESTAMP}( %{TZ})?
the %{TZ} pattern is in the default grok patterns for logstash as:
TZ (?:[APMCE][SD]T|UTC)
I'm receiving "_dateparsefailure" ONLY for logs that specify a timestamp OTHER THAN "EST" e.g. CST|PST.
If I change the clock on the Cisco device to use EST rather than PST|CST the "_dateparsefailure" stops.