Skip to content

Commit

Permalink
[filtermod] cisco date parser issues (#611)
Browse files Browse the repository at this point in the history
* [filtermod] cisco date parser issues

False error reported when cisco device sends uptime
device reported time errors will now use the indexed field cisco_time_error
Add micro seconds format without year

* Update cisco_syslog.conf

Use cisco time even when wrong
  • Loading branch information
Ryan Faircloth authored and GitHub committed Aug 7, 2020
1 parent 11496c0 commit 8f7fa8d
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions package/etc/conf.d/filters/cisco/cisco_syslog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,24 @@ parser cisco-parser-ex{
filter {
match('^(\*|\.)$' value("7"));
};
rewrite { set("cisco reported time error : ${8}" value("fields.sc4s_error")); };
} else {
parser { date-parser-nofilter(format(
'%b %d %H:%M:%S.%f',
'%b %d %H:%M:%S',
'%b %d %I:%M:%S %p.%f',
'%b %d %I:%M:%S %p',
'%b %d %Y %H:%M:%S.%f',
'%b %d %Y %H:%M:%S')
template("$8"));
};
rewrite { set("cisco reported time error : ${7}" value("fields.cisco_time_error"));
};
if {
if {
filter {
match('^\w\w\w' value("8"));
};
parser { date-parser-nofilter(format(
'%b %d %H:%M:%S.%f',
'%b %d %H:%M:%S',
'%b %d %I:%M:%S %p.%f',
'%b %d %I:%M:%S %p',
'%b %d %Y %H:%M:%S.%f',
'%b %d %H:%M:%S.%f',
'%b %d %Y %H:%M:%S')
template("$8"));
};
};
};
} else {
#Cisco AireOS format
Expand Down

0 comments on commit 8f7fa8d

Please sign in to comment.