From: eldy <> Date: Sat, 1 Sep 2001 18:49:18 +0000 (+0000) Subject: Add methodurlnoprot in possible rules to define log format. X-Git-Tag: AWSTATS_1_0~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed4a26ad1decea24d3d52dd5c8a992069719b876;p=thirdparty%2FAWStats.git Add methodurlnoprot in possible rules to define log format. --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index dbc8606e..8072fc36 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -36,20 +36,21 @@ LogFile="/var/log/httpd/mylog.log" # README.txt to setup your server to create log files with required format). # If your log is a personalised format, you must use the following syntax # keys to define your log format : -# %host Host client name or IP adress -# %time1 Date and time with format [dd/mmm/yyyy:hh:mm:ss +0000] -# %time2 Date and time with format yyyy-mm-dd hh-mm-ss -# %methodurl Method and URL with format "GET /index.html HTTP/x.x" -# %method Method with format GET -# %url URL only with format /index.html -# %code HTTP return code with format xxx -# %bytesd Size of document in bytes -# %refererquot Referer page with format "http://from.com/from.htm" -# %referer Referer page with format http://from.com/from.htm -# %uaquot User agent with format "Mozilla/4.0 (compatible, ...)" -# %ua User agent with format Mozilla/4.0_(compatible...) +# %host Host client name or IP adress +# %time1 Date and time with format [dd/mmm/yyyy:hh:mm:ss +0000] +# %time2 Date and time with format yyyy-mm-dd hh-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 +# %url URL only with format /index.html +# %code HTTP return code with format xxx +# %bytesd Size of document in bytes +# %refererquot Referer page with format "http://from.com/from.htm" +# %referer Referer page with format http://from.com/from.htm +# %uaquot User agent with format "Mozilla/4.0 (compatible, ...)" +# %ua User agent with format Mozilla/4.0_(compatible...) # If your log format has some fields not included in this list, use -# %other Means another field +# %other Means another field # # Examples for Apache combined logs (this two examples are equivalent): # LogFormat = 1 diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 1b58728f..a8b87f1b 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -71,7 +71,7 @@ $found, $internal_link, $new) = (); %MonthBytes = %MonthHits = %MonthHostsKnown = %MonthHostsUnknown = %MonthPages = %MonthUnique = %MonthVisits = %monthlib = %monthnum = (); -$VERSION="3.1 (build 39)"; +$VERSION="3.1 (build 40)"; $Lang="en"; # Default value @@ -2010,6 +2010,14 @@ if ($UpdateStats) { $i++; $PerlParsingFormat .= "\\\"([^\\s]*) ([^\\s]*) [^\\\"]*\\\" "; } + if ($f =~ /%methodurlnoprot$/) { + $found=1; + $pos_method = $i; + $i++; + $pos_url = $i; + $i++; + $PerlParsingFormat .= "\\\"([^\\s]*) ([^\\s]*)\\\" "; + } if ($f =~ /%method$/ || $f =~ /cs-method$/) { $found=1; $pos_method = $i; @@ -2064,10 +2072,6 @@ if ($UpdateStats) { if ($pos_url eq "") { error("Error: Your personalised LogFormat does not include all fields required by AWStats (Add \%methodurl or \%url in your LogFormat string)."); } if ($pos_code eq "") { error("Error: Your personalised LogFormat does not include all fields required by AWStats (Add \%code in your LogFormat string)."); } if ($pos_size eq "") { error("Error: Your personalised LogFormat does not include all fields required by AWStats (Add \%bytesd in your LogFormat string)."); } - if ($LogFormat != 4) { # If not common format, referer and agent are required - if ($pos_referer eq "") { error("Error: Your personalised LogFormat does not include all fields required by AWStats (Add \%referer or \%refererquot in your LogFormat string)."); } - if ($pos_agent eq "") { error("Error: Your personalised LogFormat does not include all fields required by AWStats (Add \%ua or \%uaquot in your LogFormat string)."); } - } &debug("PerlParsingFormat is $PerlParsingFormat");