<ul>
FAQ-COM025 <a href="#NOLOG">How to use AWStats with no server log</a><br>
FAQ-COM050 <a href="#LIMITLOG">What is the log size limit AWStats can analyze ?</a><br>
-FAQ-COM090 <a href="#FTP">Setup for FTP server log files.</a><br>
+FAQ-COM090 <a href="#FTP">Setup for FTP server log files (proftpd, vsftpd, ...).</a><br>
FAQ-COM100 <a href="#MAIL">Setup for MAIL log files (Postfix, Sendmail, QMail, MDaemon, Exchange).</a><br>
FAQ-COM110 <a href="#MEDIASERVER">Setup for MEDIA SERVER log files (Realmedia, Windows media, Darwin streaming server).</a><br>
FAQ-COM120 <a href="#ROTATE">How to rotate my logs without loosing data.</a><br>
<b>Apache 1.3.x and 2.x</b>, <b>IIS 5.0 and 6.0</b>, WebStar, WebLogic, WebSite, <b>Windows Media Server</b>, Tomcat, <b>Squid</b>,
Sambar, Roxen, Resin, RealMedia server, Oracle9iAS, <b>Lotus Notes/Domino</b>, Darwin, IPlanet, IceCast, ZeroBrand, Zeus, Zope, Abyss...<br>
<u>FTP servers</u><br>
-<b>ProFTP</b>, ...<br>
+<b>ProFTPd</b>, vsFTPd...<br>
<u>Mails servers</u><br>
<b>Postfix</b>, <b>Sendmail</b>, QMail, <b>Mdaemon</b>, www4mail, ...<br>
<u>Perl interpreters (all Perl >= 5.005):</u><br>
Any IIS log format (known as W3C format),<br>
Webstar native log format,<br>
Realmedia server, Windows Media Server, Darwin streaming server,<br>
-ProFTP server,<br>
+ProFTPd server, vsFTPd server,<br>
Postfix, Sendmail, QMail, Mdaemon<br>
A lot of web/wap/proxy/streaming servers log format<br>
<br>
<br>
<a name="FTP"></a><br>
-<b><u>FAQ-COM090 : SETUP FOR FTP SERVER LOG FILES</u></b><br>
+<b><u>FAQ-COM090 : SETUP FOR FTP SERVER LOG FILES (proftpd, vsftpd, ...)</u></b><br>
<font class=CProblem>PROBLEM:</font><br>
-What do I have to do to use AWStats to analyze some FTP server log files.<br>
+What do I have to do to use AWStats to analyze some FTP server log files ?<br>
<font class=CSolution>SOLUTION:</font><br>
AWStats can be used with some FTP server log files.<br>
<br>
-1- Setup your FTP log file format:<br>
+<u>With ProFTPd</u>:<br>
<br>
-With ProFTP, modify the proftpd.conf file to add the following two lines :
+1- Setup your server log file format:<br>
+<br>
+Modify the proftpd.conf file to add the following two lines :
<table width="95%" border=1 cellpadding=0 cellspacing=0><tr class=CFAQ><td class=CFAQ>
<!--<br>With ProFTPd 1.2.2:-->
<i>LogFormat awstats "%t %h %u %m %f %s %b"</i> # WARNING: You must use a tab char between % tags and not a space !
<br>
2- Then setup AWStats to analyze the FTP log file:<br>
<br>
-Copy config awstats.model.conf file to "awstats.proftp.conf".<br>
+Copy config file "awstats.model.conf" to "awstats.ftp.conf".<br>
Modify this new config file:
<table width="95%" border=1 cellpadding=0 cellspacing=0><tr class=CFAQ><td class=CFAQ>
<i>
<br>
Now you can use AWStats as usual (run the update process and read statistics).<br>
<br>
+<br>
+<u>With vsFTPd, or any FTP server that log with xferlog format</u>:<br>
+<br>
+1- Check your server log file format:<br>
+<br>
+Take a look at your FTP server log file. You must have a format that match the following example to
+use this FAQ :<br>
+<table width="95%" border=1 cellpadding=0 cellspacing=0><tr class=CFAQ><td class=CFAQ>
+<i>Wed Jan 01 19:29:35 2001 1 192.168.1.1 102 /home/file1.txt b _ o r username ftp 0 * c</i>\r
+</td></tr></table>
+<br>
+2- Then setup AWStats to analyze the FTP log file:<br>
+<br>
+If your FTP log file format looks good, copy config file "awstats.model.conf" to "awstats.ftp.conf".<br>
+Modify this new config file:
+<table width="95%" border=1 cellpadding=0 cellspacing=0><tr class=CFAQ><td class=CFAQ>
+<i>
+LogFile="/var/log/xferlog"
+<br>LogType=F
+<br>LogFormat="%time3 %other %host %bytesd %url %other %other %method %other %logname %other %code %other %other"
+<br>LogSeparator="\s"
+<br>NotPageList=""
+<br>LevelForBrowsersDetection=0
+<br>LevelForOSDetection=0
+<br>LevelForRefererAnalyze=0
+<br>LevelForRobotsDetection=0
+<br>LevelForWormsDetection=0
+<br>LevelForSearchEnginesDetection=0
+<br>ShowLinksOnUrl=0
+<br>ShowMenu=1
+<br>ShowMonthStats=UVHB
+<br>ShowDaysOfMonthStats=HB
+<br>ShowDaysOfWeekStats=HB
+<br>ShowHoursStats=HB
+<br>ShowDomainsStats=HB
+<br>ShowHostsStats=HBL
+<br>ShowAuthenticatedUsers=HBL
+<br>ShowRobotsStats=0
+<br>ShowEMailSenders=0
+<br>ShowEMailReceivers=0
+<br>ShowSessionsStats=1
+<br>ShowPagesStats=PBEX
+<br>ShowFileTypesStats=HB
+<br>ShowFileSizesStats=0
+<br>ShowBrowsersStats=0
+<br>ShowOSStats=0
+<br>ShowOriginStats=0
+<br>ShowKeyphrasesStats=0
+<br>ShowKeywordsStats=0
+<br>ShowMiscStats=0
+<br>ShowHTTPErrorsStats=0
+<br>ShowSMTPErrorsStats=0
+</i></td></tr></table>
+<br>
+Now you can use AWStats as usual (run the update process and read statistics).<br>
+<br>
+
<a name="MAIL"></a><br>
-<b><u>FAQ-COM100 : SETUP FOR MAIL LOG FILES (POSTFIX, SENDMAIL, QMAIL, MDAEMON, EXCHANGE...)</u></b><br>
+<b><u>FAQ-COM100 : SETUP FOR MAIL LOG FILES (Postfix, Sendmail, Qmail, MDaemon, Exchange...)</u></b><br>
<font class=CProblem>PROBLEM:</font><br>
-What do I have to do to use AWStats to analyze my mail log files.<br>
+What do I have to do to use AWStats to analyze my mail log files ?<br>
<font class=CSolution>SOLUTION:</font><br>
<br>
This tip works with AWStats 5.5 or higher.<br>
For this reason, an "exact" log analysis is a joke with Exchange log files.
However a little support is provided. In order to analyze Exchange traffic, you have to
enable "Message Tracking" (see article http://support.microsoft.com/default.aspx?scid=kb;EN-US;246856).<br>
-Copy config awstats.model.conf file to "awstats.mail.conf".<br>
+Then copy config awstats.model.conf file to "awstats.mail.conf".<br>
Modify this new config file:
<table width="95%" border=1 cellpadding=0 cellspacing=0><tr class=CFAQ><td class=CFAQ>
<i>
Also don't forget that with Exchange, informations in a log analyses can't be exact.
Do not send any questions or requests for using AWStats with Exchange, this is not a problem in
AWStats and we have no time to support non opened products.<br>
-If you want to have complete and accurate information, forget using AWStats or use a more serious
-mail serveur (Postfix, Sendmail, QMail...)<br>
+If you want to have complete and accurate information with Exchange, forget using AWStats or use a
+more serious mail serveur (Postfix, Sendmail, QMail...)<br>
<br>
<a name="MEDIASERVER"></a><br>
and <i>LogSeparator="\s+"</i><br>
<table bgcolor=#F4F4F4 width="100%" class=CFAQ><tr class=CFAQ><td class=CFAQ>
-<u>If you use a FTP server like <b>ProFTP</b>:</u><br>
+<u>If you use a FTP server like <b>ProFTPd</b>:</u><br>
See <a href="#FTP">FAQ-COM090</a>.<br>
</td></tr></table>
my $month=shift||'';
my $xml=($BuildHistoryFormat eq 'xml'?1:0);
- my ($xmlbb,$xmlbs,$xmlbe,$xmlhb,$xmlhs,$xmlhe,$xmlrb,$xmlrs,$xmlre,$xmleb,$xmlee)=();
+ my ($xmlbb,$xmlbs,$xmlbe,$xmlhb,$xmlhs,$xmlhe,$xmlrb,$xmlrs,$xmlre,$xmleb,$xmlee)=('','','','','','','','','','','');
if ($xml) { ($xmlbb,$xmlbs,$xmlbe,$xmlhb,$xmlhs,$xmlhe,$xmlrb,$xmlrs,$xmlre,$xmleb,$xmlee)=("</comment><nu>\n",'</nu><recnb>','</recnb><table>','<tr><th>','</th><th>','</th></tr>','<tr><td>','</td><td>','</td></tr>','</table><nu>',"\n</nu></section>" ); }
else { $xmlbs=' '; $xmlhs=' '; $xmlrs=' '; }
$PerlParsingFormat .= "\\\"?([^\\\"]*)\\\"?"; # logname can be "value", "" and - in same log (Lotus notes)
}
# Date format
- elsif ($f =~ /%time1$/ || $f =~ /%time1b$/) { # [dd/mmm/yyyy:hh:mm:ss +0000] ou [dd/mmm/yyyy:hh:mm:ss], time1b kept for backward compatibility
+ elsif ($f =~ /%time1$/ || $f =~ /%time1b$/) { # [dd/mmm/yyyy:hh:mm:ss +0000] or [dd/mmm/yyyy:hh:mm:ss], time1b kept for backward compatibility
$pos_date = $i; $i++; push @fieldlib, 'date';
$pos_tz = $i; $i++; push @fieldlib, 'tz';
$PerlParsingFormat .= "\\[([^$LogSeparatorWithoutStar]+)( [^$LogSeparatorWithoutStar]+)?\\]";
$pos_date = $i; $i++; push @fieldlib, 'date';
$PerlParsingFormat .= "([^$LogSeparatorWithoutStar]+\\s[^$LogSeparatorWithoutStar]+)"; # Need \s for Exchange log files
}
- elsif ($f =~ /%time3$/) { # mon d hh:mm:ss
+ elsif ($f =~ /%time3$/) { # mon d hh:mm:ss or mon dd hh:mm:ss yyyy or day mon dd hh:mm:ss or day mon dd hh:mm:ss yyyy
$pos_date = $i; $i++; push @fieldlib, 'date';
- $PerlParsingFormat .= "(\\w\\w\\w \\s?\\d+ \\d\\d:\\d\\d:\\d\\d)";
+ $PerlParsingFormat .= "(?:\\w\\w\\w )?(\\w\\w\\w \\s?\\d+ \\d\\d:\\d\\d:\\d\\d(?: \\d\\d\\d\\d)?)";
}
elsif ($f =~ /%time4$/) { # ddddddddddddd
$pos_date = $i; $i++; push @fieldlib, 'date';
}
elsif ($dateparts[0] =~ /^....$/) { my $tmp=$dateparts[0]; $dateparts[0]=$dateparts[2]; $dateparts[2]=$tmp; }
elsif ($field[$pos_date] =~ /^..:..:..:/) { $dateparts[2]+=2000; my $tmp=$dateparts[0]; $dateparts[0]=$dateparts[1]; $dateparts[1]=$tmp; }
- elsif ($dateparts[0] =~ /^...$/) { my $tmp=$dateparts[0]; $dateparts[0]=$dateparts[1]; $dateparts[1]=$tmp; $dateparts[5]=$dateparts[4]; $dateparts[4]=$dateparts[3]; $dateparts[3]=$dateparts[2]; $dateparts[2]=$nowyear; }
+ elsif ($dateparts[0] =~ /^...$/) { my $tmp=$dateparts[0]; $dateparts[0]=$dateparts[1]; $dateparts[1]=$tmp; $tmp=$dateparts[5]; $dateparts[5]=$dateparts[4]; $dateparts[4]=$dateparts[3]; $dateparts[3]=$dateparts[2]; $dateparts[2]=$tmp||$nowyear; }
if ($MonthNum{$dateparts[1]}) { $dateparts[1]=$MonthNum{$dateparts[1]}; } # Change lib month in num month if necessary
# Now @dateparts is (DD,MM,YYYY,HH,MM,SS) and we're going to create $timerecord=YYYYMMDDHHMMSS