A:Isn't standard in Apache. In my server
log record is time - remote IP info and just incomming
request. Unlike Apache with my log you can repeat request via
telnet, to check errors in scripts. You can create easy script
that convert my log file in any format. Here is an example on
Perl:
open(IFILE,"<$ARGV[0]") || die("Cant open source file");
open(OFILE1,">access$ARGV[0]") || die("Cant open target file");
open(OFILE2,">ref$ARGV[0]") || die("Cant open target file");
open(OFILE3,">error$ARGV[0]") || die("Cant open target file");
while(<IFILE>)
{
chop $_;
if($_ eq ''){$ip=''; $dat=''; $tim=''; $url=''; $prev='';}
else
{($a,$b,$c)=split(/\>/, $_ ,3);
if($a eq '!-')
{($dat,$tim,$ip)=split(/ /, $b ,3);
$ip =~ tr/\[\://d;
}
else
{($a,$b)=split(/ /, $_ ,2);
if( $a eq 'GET' || $a eq 'POST' )
{ ($url,$b)=split(/ /, $b ,2);
printf OFILE1 '%s - - [%s/2002 %s] "%s" 200
',$ip,$dat,$tim,$_;
}
elsif($a eq 'Error.' )
{ printf OFILE3 '[%s/2002 %s] access to %s failed for %s, reason: %s
',$dat,$tim,$prev,$ip,$b;
}
elsif($a eq 'Error' )
{ printf OFILE3 '[%s/2002 %s] failed for %s, reason: %s
',$dat,$tim,$ip,$b;
}
elsif($a eq 'Referer:' ){printf OFILE2 '%s -> %s
',$b,$url; }
else{$prev=$_;}
}
}
}
close IFILE;
close OFILE1;
close OFILE2;
close OFILE3;