]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
New: Add patch #197
authoreldy <>
Sun, 10 Feb 2013 15:39:22 +0000 (15:39 +0000)
committereldy <>
Sun, 10 Feb 2013 15:39:22 +0000 (15:39 +0000)
docs/awstats_changelog.txt
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index b854eefcdacec0235670b046c85f9ce618828e58..9df917538bb9ff4db9834329e4c1053d2cbc5406 100644 (file)
@@ -7,7 +7,7 @@ $Revision$ - $Author$ - $Date$
 
 New features:
 - Add windows 8 detection
-
+- Add support of %time5 for iso date times.
 
 
 ***** 7.1 *****
index c9487e4f3796ed67b4955556dc7890a2dbba067d..d900e1d773df7f7014e245f9752892a46896ffa2 100644 (file)
@@ -83,6 +83,7 @@ LogType=W
 #   %time2            Date and time with format: yyyy-mm-dd hh:mm:ss
 #   %time3            Date and time with format: Mon dd hh:mm:ss or Mon dd hh:mm:ss yyyy
 #   %time4            Date and time with unix timestamp format: dddddddddd
+#   %time5            Date and time with format iso: yyyy-mm-ddThh:mm:ss
 #   %methodurl        Method and URL with format: "GET /index.html HTTP/x.x"
 #   %methodurlnoprot  Method and URL with format: "GET /index.html"
 #   %method           Method with format: GET
index 872c2497921f0467335bdd0a6070e45dbd4fcc15..18a9a865108887b4d4bc3c656b2308ae9890b975 100644 (file)
@@ -9075,6 +9075,16 @@ sub DefinePerlParsingFormat {
                                push @fieldlib, 'date';
                                $PerlParsingFormat .= "(\\d+)";
                        }
+                       elsif ( $f =~ /%time5$/ ) {    # yyyy-mm-ddThh:mm:ss+00:00 (iso format)
+                               $pos_date = $i;
+                               $i++;
+                               push @fieldlib, 'date';
+                               $pos_tz = $i;
+                               $i++;
+                               push @fieldlib, 'tz';
+                               $PerlParsingFormat .=
+"([^$LogSeparatorWithoutStar]+)\\+([^$LogSeparatorWithoutStar]+)";
+                       }
 
                        # Special for methodurl and methodurlnoprot
                        elsif ( $f =~ /%methodurl$/ ) {
@@ -18189,12 +18199,13 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' )
                }
 
                $field[$pos_date] =~
-                 tr/,-\/ \t/:::::/s;  # " \t" is used instead of "\s" not known with tr
+                 tr/,-\/ \tT/::::::/s;  # " \t" is used instead of "\s" not known with tr
                my @dateparts =
-                 split( /:/, $field[$pos_date] )
-                 ; # tr and split faster than @dateparts=split(/[\/\-:\s]/,$field[$pos_date])
-                # Detected date format: dddddddddd, YYYY-MM-DD HH:MM:SS (IIS), MM/DD/YY\tHH:MM:SS,
-                # DD/Month/YYYY:HH:MM:SS (Apache), DD/MM/YYYY HH:MM:SS, Mon DD HH:MM:SS
+                 split( /:/, $field[$pos_date] ); # tr and split faster than @dateparts=split(/[\/\-:\s]/,$field[$pos_date])
+                # Detected date format: 
+                # dddddddddd, YYYY-MM-DD HH:MM:SS (IIS), MM/DD/YY\tHH:MM:SS,
+                # DD/Month/YYYY:HH:MM:SS (Apache), DD/MM/YYYY HH:MM:SS, Mon DD HH:MM:SS,
+                # YYYY-MM-DDTHH:MM:SS (iso)
                if ( !$dateparts[1] ) {    # Unix timestamp
                        (
                                $dateparts[5], $dateparts[4], $dateparts[3],