Thursday, May 26, 2005

Resolving apache logs for feeding webdruid with.
Dnsresolver (based on db3) doesn't always compile or work
in webalizer/webdruid.
Found another way with logresolve (from apache)
Small little tool - does only one job and does it well.
Logs are generated daily with rotatelogs inside apache
configuration file

Yah perl again

#resolve_logs.pl
my $dir="/opt/Apache/logs/";
opendir(DIR, "$dir");

@files = sort(grep(/access200506/, readdir(DIR)));

closedir(DIR);



foreach (@files) {
my $LogFile,$LogFileResolved;
$LogFile = "$dir"."$_";
$LogFileResolved = "$dir"."resolved_"."$_";
# print("$_\n") unless -d;
print ("$LogFile\n");
system("/usr/sbin/logresolve <$LogFile>$LogFileResolved");
print ("$LogFileResolved\n");
}


No comments: