Cisco log format:
Code: Select all
<189>166936: .Mar 27 2015 10:00:11.061 UTC: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/0/9, changed state to upCode: Select all
input {
syslog {
type => 'syslog'
port => 5544
}
tcp {
type => 'eventlog'
port => 3515
codec => json {
charset => 'CP1252'
}
}
tcp {
type => 'import_raw'
tags => 'import_raw'
port => 2056
}
tcp {
type => 'import_json'
tags => 'import_json'
port => 2057
codec => json
}
tcp {
port => 514
type => "syslog"
tags => [ "Cisco" ]
}
udp {
port => 514
type => "syslog"
tags => [ "Cisco" ]
}
}
filter {
if [program] == 'apache_access' {
grok {
match => [ 'message', '%{COMBINEDAPACHELOG}']
}
date {
match => [ 'timestamp', 'dd/MMM/yyyy:HH:mm:ss Z' ]
}
mutate {
replace => [ 'type', 'apache_access' ]
convert => [ 'bytes', 'integer' ]
convert => [ 'response', 'integer' ]
}
}
if "Cisco" in [tags] {
grok {
patterns_dir => "/usr/local/nagioslogserver/logstash/patterns"
match => [ "message", "<%{POSINT:seqnum1}>%{POSINT:seqnum2}:%{SPACE} .%{CISCOTIMESTAMPZ:cisco_timestamp}: \%%{DATA:facility}-%{POSINT:severity}-%{DATA:mnemonic}: %{GREEDYDATA:log_message}" ]
}
}
}
output {
elasticsearch { host => localhost }
stdout { codec => rubydebug }
}Code: Select all
CISCOTIMESTAMPZ %{MONTH} +%{MONTHDAY}(?: %{YEAR})? %{TIME} %{TZ}