## README for superstat (c)1999 Pete Nelson http://www.serversolved.com/superstat/ A Special Note: This program is no longer maintained by the author. This program may soon be replaced - no sooner did I get it posted online, when I started to notice it's shortcomings. For example -- once the meta file is generated, you have a list of pages visited and their number of hits; a list of clients and their number of hits; a list of 404's and their number of hits -- but none of these lists relate back to each other in any way. Also, it has been brought to my attention that very large log files (such as a gigabyte) can cause the application to run out of memory -- not too shocking, really. Superstat was one of the first perl programs I had written, and felt worth distributing. While it has it's limitations, I'm hoping that if nothing else, the program might give someone insite on ways perl & regular expresions can be utilized. COPYRIGHT INFO ============== You may freely use, edit, and distribute this program free of charge, under the condition that the copyrite information remains in tact. The sale of this program is expressly forbidden. WHAT DOES IT DO? ================ Superstat takes a server's access log, and generates statistics including top requests, most frequently visited directories, top clients, and even and hourly breakdown of activity. The most common way to use superstat is with the command: superstat --infile=access.archive --outfile=stats.html (If you don't have the 'Getopt::Long' module for perl, you would use the command 'superstat access.archive stats.html' to achive the same effect) It is highly advised that you NOT run superstat on an active log file! This is just a bad idea in general. You should alway rotate (archive) the access log or at least make a copy of the log to analyze. If you run this program on an active log file, it is quite possible your server will stop writing to it! Superstat also creates a metafile through the 'Storable' module for perl. (It's a very strait-forward usage of Storable - see Storable's documentation for more details.) The metafile is handy for changing the formatting of the output file without having to re-parse the log file again. To my knowledge, you should be able to change any option (with the exception of '--infile') and get the same end results from a metafile as you would from re-parsing the log. A NOTE ON MODULES ================= This program uses three modules by default. You can still analyze access logs and generate a web page without these modules, but you'll have to make a few simple changes, and you'll miss out on a few features! Storable - used to create a 'meta' file for faster loading. comment out the 'use Storable;' line, and add '$NO_STOR = 1;' Socket - used for performing hostlookups. comment out the 'use Socket;' line, and add '$NO_SOCK = 1;' Getopt::Long - used to parse command line options comment out the 'use Getopt::Long;' and add '$NO_OPT = 1;' (you can still use all the options by including them in the config file) INSTALLATION ============ This should be a cakewalk. Set '$DEFAULT_CONFIG_FILE' to where ever you keep superstat.cfg, and have '$null_dev' point to '/dev/null' (Unix) or 'nul' (DOS). USAGE ===== If you have the Getopt::Long module available, you have the following switches: --infile=filename the access log you want to analyze. If the name ends with '.meta', the file is imported as a metafile --outfile=filename The HTML output file. (You can specify 'STDOUT') --[no]graph use --graph to generate an hourly breakdown --[no]hostlookup do hostlookups for Top Clients (off if $NO_SOCK is set) --use_meta_default if {filename}.meta exists, use the meta file --silent | --quiet Does not send messages to STDOUT. (Setting 'outfile=STDOUT' automatically sets --silent, sending only the HTML to STDOUT instead) --hidden_dirs=list a quoted list of directorys that you don't want displayed on the generated page. '/cgi-bin/' is a good example. Note that the command line option does not overwrite the list in the config file, but appends them. There is no way to display directories listed as 'hidden' in the config file. --least_hits=n Don't show URLs that got less than n hits --max_dirs=n Show the top n dirs --max_clients=n Show the top n clients --server=servername The name of your server --body_def=s Anything here is placed between '
' in the generated HTML (eg: bgcolor=white text=black) --table_def=s Like --body_def, but for generated tables --table_header_def=s Like --body_def, but between '