




|
Tech Tips2
How to estimate the frequency of web page surfing per hour every day from Apache?
Author: Ben|Date: 2007/05/31|Back to Tech Tips
To estimate the frequency of web page surfing per hour every day from Apache access_log, a simple Perl programming is shown as follows:
#!/usr/bin/perl -w open ( FH, "../../access_log.1" ); while ( { chomp; $_ =~ s/^.*?:(\d{2}):.*/$1/; $hr{$_}++; } close( FH ); foreach ( sort keys %hr ) { print "Hour $_ has $hr{$_} times access.\n"; } -- |