imported>DrOwl (New page: run like this: <pre> perl rpm.pl < logfile.log > outputfile.out #!/usr/bin/perl while (<>) { #[01/Oct/2004:00:00:01 +0000] if (/\[\d{2}\/[A-Za-z]{3}\/\d{4}:(\d\d):(\d\d)/) { ...) |
imported>DrOwl m (APache Requests Per Minute moved to Apache Requests Per Minute) |
||
(No difference)
|
Latest revision as of 17:33, 30 April 2008
run like this:
perl rpm.pl < logfile.log > outputfile.out #!/usr/bin/perl while (<>) { #[01/Oct/2004:00:00:01 +0000] if (/\[\d{2}\/[A-Za-z]{3}\/\d{4}:(\d\d):(\d\d)/) { $h=$1; $m=$2; if ($m == $lastm) { $cpm++; } else { print "$h:$lastm:$cpm\n"; $lastm=$m; $cpm=1; } } }