##
open (LOGFILE2,"audit_log") || die " Error opening log file $logFile.\n";
#printf "\n";
while () {
if (/mod_security-message[:](.*)\./)
{
$MOD_SEC{$1}++
}
close (LOGFILE);
#--------------------------------------#
# Output the number of hits per file #
#--------------------------------------#
print "TOP $NUM_RECS_TO_PRINT PATTERN MATCH:\n";
print "-----------------------------\n\n";
$count=1;
foreach my $modsec (sort {$MOD_SEC{$b} <=> $MOD_SEC{$a}} (keys(%MOD_SEC))) {
last if ($count > $NUM_RECS_TO_PRINT);
print "$count\t$modsec= $MOD_SEC{$modsec} \n";
$count++;
}
print "\n\n";