Retourner au contenu associé (entrée de forum : Apache::ParseLog Et le parsing de log apache)
Posté par eMerzh (site web personnel) le 14 février 2006 à 09:03. En réponse au message Apache::ParseLog Et le parsing de log apache. Évalué à 1.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: Pas facile comme ca
Posté par eMerzh (site web personnel) . En réponse au message Apache::ParseLog Et le parsing de log apache. Évalué à 1.
dans le httpd.conf :
-----
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T %v" full
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /var/log/apache/access.log combined
mon code :
----------------
#!/usr/bin/perl
use Apache::ParseLog;
$conf = "/etc/apache/httpd.conf";
$base = new Apache::ParseLog($conf);
$base->config([%fields]);
$tr=$base->getCustomLog("combined");
if($tr==0)
{
print "null";
exit;
}
%hit = $tr->hitbydate();
foreach (sort keys %hit) {
print "$_:\t$hitbydate{$_}\n"; # <date>: <hit counts>
}
exit;