Michelle Konzack wrote:
> What I need is a program/script which can put the log
> directly into the PostgreSQL for Real-Time analysis.

I'm using perls Text::ParseWords for doing this:

If you have the classic combined LogFormat:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" 
combined

You can do:

use Text::ParseWords;
use DBI;
# Database connect here

while(<>) {
  my ($remote_host, $logname, $authuser, $time, $request,
  $status, $size, $referer, $user_agent) = quotewords(/\s+/, 0, $_)
  $dbh->do("INSERT ..."); 
}

$time can be easily converted by using HTTP::Date.

bye,
DaTa

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to