Learn Perl: Perl programs: log-reader.cgi
 
The "log-reader.cgi" CGI program

Description - version 1.0

The log-reader.cgi program is designed to operate as a Perl/CGI program. It reads the Apache access_log file in standard ECLF format, interprets the records in this file, and returns (a) the most popular URL's on your web site and (b) the top TCP/IP addresses of clients who visited your web site.

With this information, you can determine which URL's on your site are popular, and who they appeal to. You can also tell if somebody has been spidering your web site by looking for uncommonly high numbers of hits from one web site address.


Sample code output

Here's a look at the sample output that will be generated if you tell the program to print the top 10 URL's that were accessed:
		NUMBER OF HITS PER FILE:
		------------------------

		946              /
		498              /Dir/
		477              /java/
		454              /perl/
		340              /Dir/Java/Articles_and_Tutorials/
		301              /Dir/Perl/Articles_and_Tutorials/
		166              /java/applets/DigitalClock/
		157              /unix/
		99               /java/edu/pj/pj010020/
		91               /java/applets/AnimatedAd/
		
(Note: TCP/IP addresses are not shown here to protect our readers privacy.)

Download it here

Click here to view and download the log-reader program - it's 100% free.