Apacheログ解析PerlモジュールParse::AccessLogEntry
Apacheのログ解析は少々面倒な文字列正規表現となるため、お手軽なモジュールを利用します。
このモジュールは、1行ずつApacheのログを処理します。
use Parse::AccessLogEntry;
my $P=Parse::AccessLogEntry::new();
# $Line is a string containing one line of an access log
my $ref=$P->parse("$Line");
詳細は以下です。
$ref->{host} client ip of the request
$ref->{user} user logged in ("-" for none)
$ref->{date} date of the request
$ref->{time} server time of the request
$ref->{diffgmt} server offset from GMT
$ref->{rtype} type of request (GET, POST, etc)
$ref->{file} file requested
$ref->{proto} protocol used (HTTP/1.1, etc)
$ref->{code} code returned by apache (200, 304, etc)
$ref->{bytes} number of bytes returned to the client
$ref->{refer} referrer
$ref->{agent} user-agent
