[ Top | Up | Prev | Next | Map | Index ]

Readme for analog 4.04

Configuring the output

So far we have mainly discussed commands which control how analog reads the logfiles. We now get on to commands for configuring the output.

There are 32 different reports which analog can produce, if your logfiles contain the necessary information. Each one has a short name, and a code letter or number, as follows:

x  GENERAL      General Summary
m  MONTHLY      Monthly Report
W  WEEKLY       Weekly Report
D  FULLDAILY    Daily Report
d  DAILY        Daily Summary
H  FULLHOURLY   Hourly Report
h  HOURLY       Hourly Summary
4  QUARTER      Quarter-Hour Report
5  FIVE         Five-Minute Report
S  HOST         Host Report
Z  ORGANISATION Organisation Report
o  DOMAIN       Domain Report
r  REQUEST      Request Report
i  DIRECTORY    Directory Report
t  FILETYPE     File Type Report
z  SIZE         File Size Report
P  PROCTIME     Processing Time Report
E  REDIR        Redirection Report
I  FAILURE      Failure Report
f  REFERRER     Referrer Report
s  REFSITE      Referring Site Report
N  SEARCHQUERY  Search Query Report
n  SEARCHWORD   Search Word Report
k  REDIRREF     Redirected Referrer Report
K  FAILREF      Failed Referrer Report
B  FULLBROWSER  Browser Report
b  BROWSER      Browser Summary
p  OSREP        Operating System Report
v  VHOST        Virtual Host Report
u  USER         User Report
J  FAILUSER     Failed User Report
c  STATUS       Status Code Report
For details on what the various reports mean, and a summary of the commands which control them, see the section on Analog's reports.
You can turn each report on or off with configuration commands like
FIVE OFF
REFSITE ON
or by using command line arguments like -5 and +s. You can also turn all reports except the General Summary on or off with the commands ALL ON and ALL OFF, or with the command line arguments +A and -A.

You can turn the "Go To" lines in the report off with the command

GOTOS OFF
GOTOS ON turns them on again, and GOTOS FEW puts the "Go To" lines just at the top and bottom. GOTOS OFF can be abbreviated with the -X command line argument, and GOTOS ON with +X.

You can turn off the "Program started at" line at the top of the report, and the "Running Time" line at the bottom, with the command

RUNTIME OFF
and turn them on again with RUNTIME ON.

The figures in parentheses in the General Summary are for the last seven days: either the seven days before the TO time, or if no TO time is given, the seven days before the time of the program start. The figures for the last seven days are normally included if some, but not all, of the requests fall in those seven days; but you can turn them off by means of the command

LASTSEVEN OFF
Of course LASTSEVEN ON turns them on again.

You can change the order of the reports by means of the REPORTORDER command. You should list the code letters for all possible reports in the order you want them. Non-alphanumeric characters are ignored and so can be used as separators. For example,

REPORTORDER x-mdDhH45W-cPz-ritEI-SZo-sNnfKk-uJ-v-bBp

You can change which file the output goes to with a command like
OUTFILE stats.htm
or with a command line argument like +Ostats.htm. If you use the filename - or stdout, the output will go to standard output, which is normally the screen, but Unix users might like to redirect it to another file or even into a pipe. You can also use an absolute path name, like
OUTFILE /usr/bin/httpd/htdocs/stats.html  # Unix
OUTFILE "Hard Disk:Server Apps:WebSTAR:Analog:Report.html" # Mac

Sometimes it's convenient to include the date in the name of the OUTFILE. You can do this by including the following codes in the filename.

%D  date of month
%m  month name
%M  month number
%y  two-digit year
%Y  four-digit year
%H  hour
%n  minute
%w  day of week
So for example,
OUTFILE stats%y%M.html
will produce filenames like stats9905.html. The date used is the TO date if one was specified, and otherwise the time of the start of the program.
Now we come to some very important commands. The first is the OUTPUT command, which changes the style of the output. There are three possible output styles, HTML, ASCII and COMPUTER. The first produces Web pages, the second plain text files (which you could mail to people, for example) and the third produces output suitable for reading by a computer (useful for reading into a spreadsheet, or post-processing with a graphics package, for example). There is a separate section about the Computer readable output later. As well as a command like
OUTPUT ASCII
you can also select ASCII style with the command line argument +a, and HTML with the command line argument -a. You can also specify OUTPUT NONE for no output, if you are producing a cache file.
Next, you can change the language of the output. There are two ways to do this. The usual way is to use the LANGUAGE command. For example, the command
LANGUAGE FRENCH
will give you the output in French. The available languages at the moment are ARMENIAN, BOSNIAN, CATALAN, SIMP-CHINESE (GB2312 encoding), TRAD-CHINESE (Big5 encoding), CZECH, DANISH, DUTCH, ENGLISH, US-ENGLISH, FINNISH, FRENCH, GERMAN, GREEK, ICELANDIC, ITALIAN, JAPANESE, NORWEGIAN (Bokmål), NYNORSK, POLISH, PORTUGUESE, BR-PORTUGUESE, RUSSIAN, SERBIAN, SLOVAK, SLOVENE, SPANISH, SWEDISH, TURKISH and UKRAINIAN.

Note: The following additional languages were available in version 3 of analog: HUNGARIAN, KOREAN, LATVIAN, LITHUANIAN and ROMANIAN. I hope that they will be available for this version soon. As they are translated, they will be added to the analog home page. Version 3 of analog will also be available at the analog home page for a while, if you need one of these languages. Alternatively, you can find the language files in the lang directory, and translate the few new English phrases yourself.

The other way is to use the LANGFILE command. This is useful if you want to download a new language from the analog home page, or if you want to translate one yourself, or even if you want to change some words or phrases or the way the dates and times are formatted in the output. The LANGFILE command tells analog in which file to find the various words and phrases for a new language. For example, the command

LANGFILE lang/guarani.lng   # or
LANGFILE /usr/etc/httpd/analog/lang/guarani.lng
would read from that file. (Note that you have to include the directory name if the file isn't in the directory or folder which you're running analog from. In particular, it's not assumed to be in the same directory as the other language files.)

Some languages also have domains files available. These are normally selected automatically by the LANGUAGE command. But you can tell analog to use a different domains file with the DOMAINSFILE command. Also, some languages have translations of the form interface.

If you want to translate another language, I would be delighted! You'd be wise to contact me first to make sure that no-one else is already translating the same language. The English language file contains some brief instructions for translating new languages.


Sometimes your server is not in the same timezone as you, or at least records the times in its logfiles in a different timezone (for example GMT). So that you can get your statistics in your local time, there is a command called LOGTIMEOFFSET to change the time by a certain number of minutes. As with the LOGFORMAT command, this only affects logfiles which come later in the same configuration file.

You have to be careful using this command. Because of daylight savings time in operation in different parts of the world at different times, analog cannot attempt to convert between different timezones. So it's your responsibility to set the right offset for different times of year. For example, if you were in Chicago, but your server was recording time in GMT, you would need to specify two different time offsets, one of minus five hours for summer and one of minus six hours for winter. You would need to split your logfiles in the right places and then run commands like

LOGTIMEOFFSET -300
LOGFILE summer*.log
LOGTIMEOFFSET -360
LOGFILE winter*.log

There is also a related command called TIMEOFFSET. This tells analog how much to offset the time of the computer on which it is running (rather than the computer running the server), to get your local time.


There is a command called NOROBOTS which stops robots which obey the robots META tag from indexing your output page or following its links. Normally this is set to ON but you can specify NOROBOTS OFF if you don't mind robots finding your other pages this way. Note that you will stop far more robots if you put your stats page in your robots.txt file; on the other hand, this file has to be kept up to date by the server administrator.
There are a few more minor, although cosmetically important, commands affecting the output. First there's a command IMAGEDIR which tells analog where the various images used to make the report live. It could be a relative or an absolute URL: for example
IMAGEDIR img/   # within the same directory as the output
IMAGEDIR /img/  # off the root directory of your server

There are three commands which affect the top line of the output. First, the LOGO command allows you to replace the analog logo with another image (for example, your organisation's logo). You can say

LOGO picture.gif  # for this file
LOGO /images/picture2.gif  # a different file
LOGO none         # for no logo
The logo is assumed to be inside the IMAGEDIR unless it starts with a slash, or contains ://

Then there are commands HOSTNAME and HOSTURL which affect the name and link at the end of the title line. For example, I might specify

HOSTNAME "Stephen Turner"
HOSTURL  http://www.statslab.cam.ac.uk/~sret1/
to generate the title "Web Server Statistics for Stephen Turner". Again, you can use none as the HOSTURL to specify no link. Analog will normally translate characters in the hostname to HTML if necessary. So to include literal HTML, such as accented characters, in the output you need to precede them by a backslash, like this:
HOSTNAME "M\üller & S\öhne"

There are commands called HEADERFILE and FOOTERFILE. These let you specify files to be inserted near the top and bottom of your output. You can specify
HEADERFILE none
to cancel a previously-specified header file.
There is a command called STYLESHEET to specify a style sheet for the output. This allows you to specify colours etc. (See http://www.w3.org/Style/css/ for how to write a style sheet.) For example,
STYLESHEET /housestyle.css
STYLESHEET none   # to cancel it
Hint: a common mistake in writing style sheets is to declare a font-family for the body, but then not put <pre> sections back into a monospaced font. This stops the columns lining up properly. Your style sheet should contain a line like the following:
PRE, TT, CODE, KBD, SAMP { font-family: monospace }

There are three related commands called SEPCHAR, REPSEPCHAR and DECPOINT. These specify single characters to be used as the thousands separator in numbers, the thousands separator within the columns in the reports, and the decimal point. For example, a French user might choose
SEPCHAR " "
REPSEPCHAR none
DECPOINT ,
to make "three thousand and a quarter" look like "3 000,25" in text and "3000,25" in the reports.
There is a command called RAWBYTES. Specify RAWBYTES ON if you want the exact number of bytes to be listed in reports, or RAWBYTES OFF if you want the number of kilobytes or Megabytes as appropriate to be listed instead.
Finally there are commands called HTMLPAGEWIDTH and ASCIIPAGEWIDTH which specify the width of the page. Obviously, the former is used when the output style is HTML, and the latter when the output style is ASCII. The output is not guaranteed to fit in this width, but analog will take notice of it when choosing the width of the time graphs, when sorting the host report alphabetically, when drawing horizontal rules, and when writing some bits of text.
There are now some sections about configuring the output of particular reports, under the following headings: Time reports, Other reports and Hierarchical reports.
Stephen Turner
Need help with analog? Subscribe to the analog-help mailing list

[ Top | Up | Prev | Next | Map | Index ]