added modules list, improved syslog parsing
authorHeiko Schlittermann <hs@schlittermann.de>
Tue, 08 Dec 2009 16:41:07 +0100
changeset 4 3e11dab11c4b
parent 2 5758f12ce2d7
child 5 a6e9f5b0d25c
added modules list, improved syslog parsing
modules
postgrep
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules	Tue Dec 08 16:41:07 2009 +0100
@@ -0,0 +1,1 @@
+libtimedate-perl
--- a/postgrep	Wed Dec 02 07:48:00 2009 +0100
+++ b/postgrep	Tue Dec 08 16:41:07 2009 +0100
@@ -3,7 +3,7 @@
 use warnings;
 use Date::Parse;
 use Memoize;
-use Smart::Comments;
+use if $ENV{DEBUG} => "Smart::Comments";
 
 die "Usage: $0 pattern [file]…\n" if !@ARGV;
 
@@ -19,12 +19,12 @@
     if (
         !/^(?<date>.{15})
 	\s(?<host>\S+)
-	\s(?<service>\S+):
+	\s(?<service>postfix\/\S+):
 	\s(?<pfid>[[:xdigit:]]+):
 	\s(?<rest>.*)/x
       )
     {
-        print "$_\n" if /$pattern/i;
+        print "$_\n" if / postfix\// && /$pattern/i;
         next;
     }