Davis Home Events Living Education Business Organizations Forums Government Davis Community Network

Web Access-Log Analysis

Web Access Logs Analysis Examples

Here's how to do simple log analysis via the myhits program.

Use a telnet program to log into your DCN account. If you're using the Lynx shell, choose the "Unix Prompt" menu option. You'll see a UNIX command-line prompt that will look something like:

msmosaic@wheel ~ > 
Your login name will appear in place of "msmosaic".

At the prompt type this line (then press the Enter key):


You should immediately see the response:

Reading access log: /usr/local/etc/httpd/logs/access_log...
And, after some time,
Writing results.
and the UNIX prompt. Congratulations, you've just generated a log analysis. Now, crank up your web browser and ask for the URL: http://www.dcn.davis.ca.us/~loginid/access.html, replacing "loginid" with your DCN login ID. You should see a hit analysis for the current week.

Obtaining an analysis for a prior week

The simple example just looked at the current log file. There are also log files for previous weeks available. To list them, type:
myhits -m
and press the Enter key. The response will look something like:
Each log is named in YRMODY format for the day after its last date (the day it was rotated). You may analyze one of these files with a command like:
myhits -l 960519.access_log
(NOTE: that's the letter "l", not the digit "1") The "-l ..." addition to the command line tells myhits to look at a particular log file instead of the current one.

Popular options

myhits has many options for log file analysis. You may see a list of the options with the command:
myhits -h
A popular set of options asks for a breadown of URLs requested and of requestor domains:
myhits -ur
We can combine that with a request to analyze an old log with a command like:
myhits -ur -l 960519.access_log

Option list

Here's a list of the myhits options available at this writing:
usage: myhits [options]
Generates an HTML log file analysis.
   -h             Print this help;
   -s text        Include only URLs containing "text"
                   (default is /~msmosaic/);
   -t text        Include only requesting hosts containing "text"
   -u             Include URL breakdown;
   -r             Include requestor breakdown;
   -n             Use Netscape graphics;
   -l logfile     Read log file "logfile" (default is access_log);
   -m             List old log files available;
   -o outputfile  Output to "outputfile"
                   (default is ~/public_html/access.html)
   -x text        Exclude URLs containing "text"
   -y text        Exclude requesting hosts containing "text"
   -d             Include day-of-week bar chart
   -b             Include hour-of-day bar chart


Post your questions or suggestions for improvement in the DCN Web Discussion.

Homepage | Contact DCN | Contact DCN Web Team

Copyright © 1996-2005 The Davis Community Network
URL: http://www.dcn.davis.ca.us/about/stats/myhits.html
Last Revised: December 29, 1996