logo       

[Pound Mailing List] HOWTO convert pound logs to apache logs for webalizer: msg#00016

web.pound.general

Subject: [Pound Mailing List] HOWTO convert pound logs to apache logs for webalizer

Here is a small script to convert pound logs to be used in webalizer and
apache.

By default webalizer cannot understand pound logs because of an extra
datetime and redirect domain secton in the log entries. So we parse the
pound logs line by line to a php script choping the unwanted sections and
pipe the output to a file webalizer can read.

Requirement:
PHP 5.+
pound 2.+

pound.cfg:
LogLevel 3

makelog.sh:
# extract all pound logs
fgrep pound /var/log/messages >/tmp/t.txt

#extract and convert logs for just one site
fgrep "pound: www.abc.com" /tmp/t.txt | php -F makelog.php >/tmp/abc.com.log

makelog.php:
<?
$p = strpos($argn,"pound:",0) + 7;
$s = substr($argn,$p,strlen($argn)-$p);
$p = strpos($s," ",0);
$s = trim(substr($s,$p,strlen($s)-$p));
echo "$s\n";
?>

The result of the conversion goes to /tmp/abc.com.log in example above.
Webalizer can read this file and produce correct results.

Regards,
Gevik.



--
To unsubscribe send an email with subject 'unsubscribe' to
pound-Ws3YcLWMCps@xxxxxxxxxxxxxxxxx
Please contact roseg-Ws3YcLWMCps@xxxxxxxxxxxxxxxx for questions.
http://www.apsis.ch/pound/pound_list/archive/2006/2006-05/1147334721000



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise