Logwrangler is a perl program to generate web traffic reports using Analog, Report Magic, DNSTran, and the included
logtable.pl script (which generates a table summarizing statistics across multiple sites).
Logwrangler doesn't require special privileges, so you should run it (and all the associated programs) as an unprivileged user. In its base configration, Logwrangler does all its work inside
~/logwrangler, which should contain three directories:
cfg (for Analog config files),
data (for Analog output files), and
stat (for reports). If you want to make reports publicly visible, you can make
stat a symlink to a directory accessible through your webserver. You could set this up with
mkdir -p ~/logwrangler/cfg ~/logwrangler/data && ~/public_html/stat && cd ~/logwrangler && ln -s ../public_html/stat.
Warning: Be sure the user running Logwrangler has permission to write to Analog's
dnslock files (Analog isn't always configured this way -- you can see which files it is configured to use with
analog --settings | grep DNS) and the data and output files (
fink install analog reportmagicto get both programs.
/usr/local/binare reasonable places).
setenv PATH $PATH":/usr/local/bin:~/bin"
~/.tcshrcfile, and start a new Terminal session to pick up the configuration change; otherwise, just
rehash(if using a
csh-based shell) to pick up the new programs.
~/logwrangler/cfg); make sure nothing else is in that directory.
HOSTNAME www.reppep.com HOSTURL http://www.reppep.com/ OUTPUT COMPUTER # This could also go in the master analog.cfg OUTFILE /home/pepper/logwrangler/data/www.reppep.com.txt LOGFILE /var/log/httpd/www.reppep.com-access_log* # this should pick up compressed logs
COMPUTERoutput; if you want Analog to generate human-readable reports directly (if you're not using Report Magic, for example), use a second configuration file for each site, perhaps with
OUTPUT HTMLand something like
OUTFILE /home/pepper/logwrangler/stat/www.reppep.com/index.htmlin the other file. Note: Analog doesn't understand '
~' -- you must spell out the path to your home directory.
OUTFILE(after removing any
.datsuffix). The summary table will link to these directories. If you are not using Report Magic, you should use the same scheme for
OUTFILEin your formatted reports, or adjust the programs to suit your configuration. Note: Files other than Analog
COMPUTERoutput in the
OUTFILEdirectory may confuse Logwrangler.
logwrangler.pl, and adjust them as necessary to match your configuration. Make sure all directories mentioned in
OUTPUTcommands exist (
mkdir -p ~/logwrangler/data); Analog won't create directories.
logwrangler.pl -v-- this should run DNSTran on your logs (if available), Analog on your configuration files, Report Magic on the Analog output files, and finally
logtable.plto summarize the same output files. The
-vswitch provides verbose output; you can leave it off for less status information, or use
-qfor no output except errors.
index.html), with links to the individual reports.
~/logtable/stata symbolic link to a directory accessible from the web, or change the value of
logwrangler.pl. Security: You might want to restrict access to your reports; you can configure this in your web server.
logwrangler.pl -v will show timings for each Analog configuration run.
If you remove a configuration file, but leave its data file in $outputpath, Report Magic and
logtable.pl will continue to use the old data file.
Multilog version 1.x was a simpler
sh script to run Analog and DNSTran on a batch of files. I wrote it because I needed to crunch a lots of logfiles for many different sites nightly, and used it with
at (Windows NT's
cron equivalent). I later wrote a small supplemental
awk program to generate an HTML table summarizing stats across sites; it has been rewritten as
logtable.pl. To avoid confusion with the daemontools multilog program, version 2 has been renamed to Logwrangler.