lausser / check_logfiles

A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) which scans logfiles for patterns.
https://omd.consol.de/docs/plugins/check_logfiles/
GNU General Public License v2.0
46 stars 27 forks source link

Feature/multiline logs #35

Open norvil-khee opened 6 years ago

norvil-khee commented 6 years ago

In order to check e.g. DB2 log files, we required check_logfiles to check for patterns in log-messages which span multiple lines.

The changes in this pull request introduce two options to check_logfiles searches: multiline: if this is on, scanning of a log file will change so that multiple lines are read before the rest of the scan logic is executed. Lines read are identified by a pattern which must be given in the multilinestartpattern options, described below. multilinestartpattern: this is a pattern, identifying how a log line starts in multi-line logs. In a DB2 diag-log file this would always be a date/time combination. The scan method then takes the first line which matches this pattern and concatenates each following line as long as it does NOT match this pattern.