logwatch/logwatch-applystddate.patch
Jan Synacek 47eb5193fe Add applystddate patch - support rsyslog timestamps
Add http patch - count .hdr files as archives
Add pluto patch - update openswan parsing
Add xvc patch - support xen virtual console logins
2012-08-29 12:50:53 +02:00

27 lines
1.2 KiB
Diff

--- logwatch-svn110/scripts/shared/applystddate.orig 2011-06-25 19:21:13.000000000 +0200
+++ logwatch-svn110/scripts/shared/applystddate 2012-08-29 10:44:05.355719191 +0200
@@ -25,6 +25,7 @@
# customize the Timefilter by appending a string:
# *ApplyStdDate = "%H:%M %d/%m/%Y"
$SearchDate = TimeFilter($ARGV[0] || '%b %e %H:%M:%S');
+$SearchDateRsyslog = TimeFilter('%Y-%m-%dT%H:%M:%S\.[0-9]+[+-][0-9]{2}:[0-9]{2}');
# The date might be "Dec 09", but it needs to be "Dec 9"...
#$SearchDate =~ s/ 0/ /;
@@ -32,11 +33,15 @@
if ( $Debug > 5 ) {
print STDERR "DEBUG: Inside ApplyStdDate...\n";
print STDERR "DEBUG: Looking For: " . $SearchDate . "\n";
+ print STDERR "DEBUG: Looking For: " . $SearchDateRsyslog . "\n";
}
while (defined($ThisLine = <STDIN>)) {
if ($ThisLine =~ m/^$SearchDate /o) {
print $ThisLine;
+ } elsif ($ThisLine =~ /^$SearchDateRsyslog /o) {
+ $ThisLine =~ s/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\.[0-9]+[+-][0-9]{2}:[0-9]{2} //o;
+ print POSIX::strftime("%b %e %H:%M:%S", $6, $5, $4, $3+1, $2-1, $1 - 1900) . " " . $ThisLine;
} elsif ($ThisLine =~ m/(Mon|Tue|Wed|Thu|Fri|Sat|Sun) $SearchDate \d{4}/o) {
print $ThisLine;
}