[Home | Contact | What's New? | Products | Services | Tips | Mike |
Living with Schizoaffective Disorder

Web Server Log File Analysis with Analog continued...

Running Analog for the First Time

Analog is a command line program. You run it from a shell by passing it command line parameters.
Options in a configuration file select which reports to create.

Michael David Crawford, Baritone,

You can get to a shell to run Analog by running one of these programs:

Make a directory (or folder) to hold your work and then set your current directory to the new folder. I've done this on my Windows machine in the Cygwin bash shell:

$ cd c: mike@bjarne /cygdrive/c $ mkdir Logs mike@bjarne /cygdrive/c $ cd Logs

Now transfer your web server log file from your hosting service to your own computer. If the log file has grown large, so that it will take a long time to transfer, you should copy it to another file on your hosting service's computer and compress it with zip or gzip. Don't just compress your current log file! If you do, you'll mess it up because your web server is still using it. Compress a copy instead.

Once a month my hosting service packs the previous month's log into a gzip compressed tar file named for the date, then starts a new log file. Here I use Cygwin's scp, or Secure Copy, to transfer the compressed log file that was prepared on November 1, 2004 to my own PC:

$ scp crawford@www.goingware.com:logs/20041101.tar.gz . crawford@www.goingware.com's password: 20041101.tar.gz 100% 9923KB 77.5KB/s 02:08 mike@bjarne /cygdrive/c/Logs $ ls -s total 9923 9923 20041101.tar.gz

Now I unpack the archive. Cygwin's GNU Tar allows one to decompress and unarchive a tar.gz file in one step:

$ tar xvfz 20041101.tar.gz 20041101/ 20041101/access_log 20041101/error_log mike@bjarne /cygdrive/c/Logs $

My log file has been saved in a directory (or folder) named "20041101".

Now use a text editor to create a configuration file that we'll call "site.cfg". The configuration file needs to be a plain text, or ASCII file.

On Windows use NotePad. On Mac OS X, you can use TextEdit, but you need to open TextEdit's preferences and set the New Document Attributes to "Plain Text". With Cygwin, OS X, Unix and Linux you can use vi or emacs. Copy the following text into your configuration file:

OUTFILE site/index.html HOSTNAME "GoingWare Inc." HOSTURL http://www.goingware.com/

Change "GoingWare Inc." to the name of your website, and "http://www.goingware.com/" to the URL of your website's homepage.

Finally, create a directory called "site" to hold Analog's report, which will consist of a web page called "index.html", along with several PNG graphics files:

$ mkdir site mike@bjarne /cygdrive/c/Logs $ ls 20041101 20041101.tar.gz site site.cfg

Now we're ready to run Analog for the first time. Type the following on your command line, but substitute the path to your log file where I have "20041101/access_log". The "+g" parameter specifies the configuration file to use. Note that there is no space between the "+g" and "site.cfg". If all goes well, Analog will print a few lines of messages similar to those following the command line here:

$ analog +gsite.cfg 20041101/access_log h:\GoingWare-Logs\analog_5.32\analog.exe: analog version 5.32/Win32 h:\GoingWare-Logs\analog_5.32\analog.exe: Warning E: Redirecting future diagnostic messages to h:\GoingWare-Logs\analog_5.32\errors.txt (For help on all errors and warnings, see docs/errors.html)

Now launch your web browser, and use the Open (or Open File) command from the File menu to find and select index.html in the site folder. You should see a web page similar to Example 1.

[Home | Contact | What's New? | Products | Services | Tips | Mike]