#739 %methodurl and \t as log file separator problem

6.9
open
nobody
5
2014-08-25
2009-03-29
Victor Kuprienko
No

Config settings are:

LogType=W
LogFormat="%time2 %bytesd %host %methodurl %code %logname %referer %ua"
LogSeparator="\t"

All records in log file are dropped:

Dropped record (method/protocol 'GET /templates/Default/dleimages/rating.gif' not qualified when LogType=W): 2009-03-28 14:59:47 2332 xxx.xxx.xxx.xxx "GET /templates/Default/dleimages/rating.gif HTTP/1.1" 200 -http://hostname/index.php?option=com_joomleague&func=showPlan&tid=1&p=1&Itemid=17 Opera/9.63 (Windows NT 5.1; U; ru) Presto/2.1.1

The solution I found is to add spaces into methodurl regex classes:

                            push @fieldlib, 'url';
                            $PerlParsingFormat .=

"\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+) [^\\"]+\\"";

"\\"([^$LogSeparatorWithoutStar ]+) ([^$LogSeparatorWithoutStar ]+)(?: [^\\"]+|)\\"";

Discussion

  • AWStats version is 6.9

     
  • jockee
    jockee
    2009-04-01

    This was introduced in 6.9. Works fine with earlier versions.

     
  • mark stoughton
    mark stoughton
    2009-04-08

    %methodurl(httpd.conf LogFormat value:%r) is of the format "<method> <queryString> <protocol>". Spaces separate these values, regardless of whether you change the delimiter in httpd.conf. If you change the LogSeparator value in the awstats.conf, the code in awstats.pl wrongly assumes that the new delimiter separates the values within %methodurl.

    However, this is not the case. The delimiter remains as a space.

    The offending code. I've commented out the improper line, and replaced it beneath it:

    Special for methodurl and methodurlnoprot

                        elsif ( $f =~ /%methodurl$/ ) {
                                $pos_method = $i;
                                $i++;
                                push @fieldlib, 'method';
                                $pos_url = $i;
                                $i++;
                                push @fieldlib, 'url';
                                $PerlParsingFormat .=
    

    "\\"([^$LogSeparatorWithoutStar]+) ([^$LogSeparatorWithoutStar]+)(?: [^\\"]+|)\\"";

    "\\"([^ ]+) ([^ ]+)(?: [^\\"]+|)\\"";

     
  • David S.
    David S.
    2012-12-05

    I can say that this Bug still exists, in all versions up to 7.1 i think.