Things look quiet here. But I've been doing a lot of blogging at
dan.langille.org because I prefer WordPress now.
Not all my posts there are FreeBSD related.
I am in the midst of migrating The FreeBSD Diary over to WordPress
(and you can read about that here).
Once the migration is completed, I'll move the FreeBSD posts into the
new FreeBSD Diary website.
analog - "The most popular logfile analyser in the world"30 May 1999
I used the port. And with ports, it's very easy to install stuff. It's
mindless-no-thinking stuff. Someone else has already done all the hard work for you.
For full port installation instructions, please see Getting a FreeBSD Port
in the FreeBSD handbook.
In short, I did
This was the difficult part. It's not that the information is not provided.
It's that I found the information difficult to find. My first attempt was the
man pages. But there are none for analog. Man pages are great in that they
always provide the basic command line arguments. And it was this information which I
I was lost.
So I went back to the install output and found that it had copied files to /usr/local/share/doc/analog/.
Of course! I should have known. That's a pretty standard place to put
documents, as you can tell the from the name. In fact I went there and found only
html files. See /usr/local/share/doc/analog/Readme.html it will take you
to those documents if they exist on your local machine.
Once I'd found the documentation, it was just a matter of reading and trying to
understand it. Here's what I created for my /usr/home/dan/analog.cfg
LOGFORMAT (%S - %u [%d/%M/%Y:%h:%n:%j] "%j %r %j" %c %b)
LOGFILE /path/to/freebsd-access.log # to set where your logfile lives
OUTFILE /path/to/freebsd-usage.html # to send the output to a file
# instead of the screen
HOSTNAME "NZ FreeBSD Mirror"
Well, they may not be common errors, but I made them <grin>.
You must specify
the LOGFORMAT before the LOGFILE. This is documented, but I
still missed it. If I didn't, I got this error:
analog: Warning D: LOGFORMAT in configuration file analog.cfg with no
If I didn't specify LOGFORMAT then I got these errors:
analog: Warning F: Can't auto-detect format of logfile
/var/log/apache/freebsd-access.log: ignoring it
(For help on all errors and warnings, see docs/errors.html)
analog: Warning R: Turning off empty time reports
analog: Warning R: Turning off empty Request Report
analog: Warning R: Turning off empty File Type Report
analog: Warning R: Turning off empty Directory Report
analog: Warning R: Turning off empty Domain Report
analog: Warning R: Turning off empty Referrer Report
analog: Warning R: Turning off empty Referring Site Report
analog: Warning R: Turning off empty File Size Report
analog: Warning R: Turning off empty Status Code Report
Here's how I ran analog for the first time:
The -g means to use the configuration file specified. Note: there is
no space after the -g and before the name of the configuration file.
For more information on the configuration options, please refer to /usr/local/share/doc/analog/syntax.html.
Other configuration options
One of the options I wanted to try was referrers amongst other things. I will
write more about that once I start using them. Cheers.