comparison common/logwatch/scripts_php @ 127:bafd91f195de puppet-3.6

Fix PHP reporting in logwatch * Read correct files * Filter correct date format (as per Apache config) * Don't do "next unless" filtering in script * Handle Apache 2.4 date format
author IBBoard <dev@ibboard.co.uk>
date Sat, 17 Sep 2016 15:19:54 +0100
parents 956e484adc12
children
comparison
equal deleted inserted replaced
126:8316d4e55e92 127:bafd91f195de
42 pop(@message_categories) if $detail < 5; 42 pop(@message_categories) if $detail < 5;
43 43
44 # counting messages 44 # counting messages
45 while(<>) { 45 while(<>) {
46 my $line = $_; 46 my $line = $_;
47 # skipping messages that are not within the requested range 47 $line =~ /(\w+) (\w+) (\d+) (\d+):(\d+):(\d+)\.\d{6} (\d+)/;
48 next unless $line =~ /^\[($filter)\]/o;
49 $1 =~ /(\w+) (\w+) (\d+) (\d+):(\d+):(\d+) (\d+)/;
50 my $time; 48 my $time;
51 49
52 { 50 {
53 # timelocal is quite chatty 51 # timelocal is quite chatty
54 local $SIG{'__WARN__'} = sub {}; 52 local $SIG{'__WARN__'} = sub {};