diff options
author | Andre Lorbach <alorbach@adiscon.com> | 2013-07-12 15:35:46 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-07-22 15:46:09 +0200 |
commit | e0da083bddc90c8b91ad9a4cd57d0dee5e66b285 (patch) | |
tree | f1d9d9c12b009e4a23a053e719e2332228dd883f /plugins/impstats/statslog-splitter.py | |
parent | baa0ab8561845e98319242bfbe706af99a8a48c0 (diff) | |
download | rsyslog-e0da083bddc90c8b91ad9a4cd57d0dee5e66b285.tar.gz rsyslog-e0da083bddc90c8b91ad9a4cd57d0dee5e66b285.tar.bz2 rsyslog-e0da083bddc90c8b91ad9a4cd57d0dee5e66b285.zip |
Started implementing statslog analyzer for impstats
This script will help finding unusual things in the impstats logs
Diffstat (limited to 'plugins/impstats/statslog-splitter.py')
-rwxr-xr-x | plugins/impstats/statslog-splitter.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/plugins/impstats/statslog-splitter.py b/plugins/impstats/statslog-splitter.py index dce71a39..715b17bf 100755 --- a/plugins/impstats/statslog-splitter.py +++ b/plugins/impstats/statslog-splitter.py @@ -10,9 +10,12 @@ import sys import datetime import time -import re import os +# Include regex definitions +import statslog_regex +from statslog_regex import * + # Set default variables szInput = "rsyslog-stats.log" szOutputDir = "./" @@ -31,20 +34,6 @@ nLogLineNum = 0 nLogFileCount = 0 szChartAddArgs = "" -# Create regex for loglines -loglineregexes = [] -loglineindexes = [] - -# Traditional Format -# Sample Line: Jun 26 14:21:44 nhpljt084 rsyslogd-pstats: main Q[DA]: size=0 enqueued=0 full=0 discarded.full=0 discarded.nf=0 maxqsize=0 -loglineregexes.append( re.compile(r"(...)(?:.|..)([0-9]{1,2}) ([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}) ([a-zA-Z0-9_\-\.]{1,256}) ([A-Za-z0-9_\-\/\.]{1,32}): (.*?): (.*?) \n") ) -loglineindexes.append( {"LN_YEAR":-1, "LN_MONTH":1, "LN_DAY":2, "LN_TIME":3, "LN_HOST":4, "LN_SYSLOGTAG":5, "LN_LOGOBJECT":6, "LN_LOGDATA":7} ) - -# Newer Format -# Sample format: 2013-07-03T17:22:55.680078+02:00 devdebian6 rsyslogd-pstats: main Q: size=358 enqueued=358 full=0 discarded.full=0 discarded.nf=0 maxqsize=358 -loglineregexes.append( re.compile(r"([0-9]{4,4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})\.[0-9]{1,6}.[0-9]{1,2}:[0-9]{1,2} ([a-zA-Z0-9_\-\.]{1,256}) ([A-Za-z0-9_\-\/\.]{1,32}): (.*?): (.*?) \n") ) -loglineindexes.append( {"LN_YEAR":1, "LN_MONTH":2, "LN_DAY":3, "LN_TIME":4, "LN_HOST":5, "LN_SYSLOGTAG":6, "LN_LOGOBJECT":7, "LN_LOGDATA":8} ) - # Init result with file handles outputFiles = {} |