httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] A question about the request line and the referer
Date Sat, 02 Aug 2008 14:59:13 GMT
Paul Li wrote:
> Thanks André!
> Just one more question: if i want to retrieve from the access log the
> users' visiting history of my web site, what  would you suggest?
I would suggest to use "webalizer", or any of the similar programs which 
do about the same thing.

Seriously, there you are asking a question that is more about 
programming logic than Apache tidbits, and I'm afraid for that you'll 
have to do some work yourself.

But assuming that you committed some crime, and that the task in 
question is your punishment, here is an outline :
I would start by selecting a programming language that is good at 
parsing lines of text and manipulate them (like perl).
(You could also use awk of course.  I have some good friends that use 
awk too ;-))
Then I would split each line into its constituents (caller IP, 
date/time, result code, requested URL, ..
Then I would ignore anything that did not result in a code 200 (OK).
Then I would ignore any line that is about URLs ending in .gif, .jpeg, 
.css, etc.. (unless they are really significant in your case).
Then I would sort the remainder by caller IP (about the only element you 
have that allows to believe that this is one user) and by date/time.
And then I would really get to work, to decide what belongs to one 
single visit..

I'm sure I am forgetting 90% of the smart things that programs like 
webalizer are doing.  Not even speaking about presenting the results nicely.

Anyway, have fun !


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message