Hi!

> sorry for the second mail in this short amount of time but just had some time 
> to do more test.
> 
> I'm not really familiar with regex but using the attached patch works here 
> now with the different logfile syntax:
> 
>> [07-May-2013 08:03:24] PHP Warning: foo.bar
>> [07-May-2013 08:03:24 Europe/Berlin] PHP Warning: foo.bar
>> [07-May-2013 08:03:24 UTC] PHP Warning: foo.bar

Do you know why PHP formats the time in different formats?

I've modified the patch slightly because the regex can be formatted more
compact. Please test again.

thanks
WM
diff --git a/scripts/services/php b/scripts/services/php
index adc0147..a8574cd 100644
--- a/scripts/services/php
+++ b/scripts/services/php
@@ -62,7 +62,9 @@ pop(@message_categories) if $detail < 5;
 while(<>) {
     my $line = $_;
     # skipping messages that are not within the requested range
-    next unless $line =~ /^\[($filter)\]/o;
+    # the last part of the regex matches optionally occurring specification
+    # of timezones either in Continent/City or abbrevations like UTC
+    next unless $line =~ /^\[($filter)(?: \w+(?:\/\w+)?)?\]/o;
     $1 =~ /(\d+)-(\w+)-(\d+) (\d+):(\d+):(\d+)/;
     my $time;
 

Reply via email to