Mike's Pub -> Discussion Corner -> Support Forum for aWebVisit

 Start date [ Reply ] [ Back to Index ] Top Bottom

Author : -goe-
Date: 2001/11/26 15:56

I entered a starting date, but it seems, that AWV doesn't see it. The calculated numbers
are taken from the whole log file.

 About filtering log entries... [ Reply ] [ Back to Index ] Top Bottom

Author : Mike
Date: 2001/11/26 18:39

I'm not sure where you saw that you could specify a starting date. Are you sure this was
for aWebVisit ? :-)

Anyway, here are two ways of achieving what you want :

1) filter out the log entries you're not interested in *before* they are read by
aWebVisit
Example : on Unix/Linux/BSD-like systems, you could use "grep '/Oct/2001' logfile | perl
awebvisit" to select only the entries of the month October. Or you could split your
logfile according to day/week/month/etc., and only specify those logfiles you want
aWebVisit to read...

2) filter them out from within aWebVisit
Before the line that says
        if ($exclude_host && $host =~ /$exclude_host/io) {
you could add some code to check if the $date variable matches a particular period you're
interested in, and if not, tell aWebVisit to simply get the next line.

A simple example to only take into account entries from the month October :
if ($date !~ /Oct/) { # if $date doesn't contain the word 'Oct'
        next; # go to the next entry
}
Of course, this method is a bit slower than the first one, because it first has to read
the entry and then discard it again.

Before you try either of the methods, check out in what format dates are really displayed
in your logfile - it could be something like "2001-10-01" instead of "01/Oct/2001", for
instance.

 Reply [ Back to Index ] Top Bottom
Name : or OpenID OpenID Login
E-mail : (optional)
Subject :
Message :
MathGuard security question: 0 + 8 =
 

Mike's Pub -> Discussion Corner -> Support Forum for aWebVisit