From: ramza2
Subject: Lisp Accesslog Parser
Date: 
Message-ID: <1129671776.901273.292740@g14g2000cwa.googlegroups.com>
I thought I would point out my little helloworld access_log parser in
lisp.  Not optimized code, but this is an early release.  If you can
figure it out from the README, you are a smart person; still working on
the documentation. I also have some lisp development notes(from the
app, may not be best practice).

http://jroller.com/page/berlinbrown/20051017

"Here is a college project style application for processing the
access_log files created by Apache, in the intent to create web
reports."

From: Pascal Bourguignon
Subject: Re: Lisp Accesslog Parser
Date: 
Message-ID: <87vezu5tsk.fsf@thalassa.informatimago.com>
"ramza2" <············@gmail.com> writes:

> I thought I would point out my little helloworld access_log parser in
> lisp.  Not optimized code, but this is an early release.  If you can
> figure it out from the README, you are a smart person; still working on
> the documentation. I also have some lisp development notes(from the
> app, may not be best practice).
>
> http://jroller.com/page/berlinbrown/20051017
>
> "Here is a college project style application for processing the
> access_log files created by Apache, in the intent to create web
> reports."

Wouldn't it be more efficient (programmer time) to configure Apache to
write logs in form of s-expressions?

Put:

LogFormat "(\"%h\" \"%l\" \"%u\" \"%t\" \"%r\" %>s %b)" common
CustomLog logs/access_log common

in httpd.conf

and:

(defstruct (alog (:type list))
           host ident user timestamp request status size)

(loop :for log-line = (read log-stream nil nil)
      :while log-line
      :do (process log-line))

Ok, you may want to translate the timestamp string into a universal
time, and the request into components (method, url, protocol,
version).


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

The world will now reboot.  don't bother saving your artefacts.
From: ramza2
Subject: Re: Lisp Accesslog Parser
Date: 
Message-ID: <1129677449.493073.102670@o13g2000cwo.googlegroups.com>
Trust me, I could think of a million things to improve on it.  In fact,
I had the read-from-string function and then a tokenize string,
probably should have picked one.

That does help.

Here is the output.

http://www.newspiritcompany.com/newstats/reports/newstats5253117102005.html

I wanted to go for urchin style stats, but right now it is just a
simple bean counter.  All in due time.
From: Kalle Olavi Niemitalo
Subject: Re: Lisp Accesslog Parser
Date: 
Message-ID: <87wtk9kr4v.fsf@Astalo.kon.iki.fi>
Pascal Bourguignon <····@mouse-potato.com> writes:

> LogFormat "(\"%h\" \"%l\" \"%u\" \"%t\" \"%r\" %>s %b)" common

If you do this, it would be prudent to bind *READ-EVAL* to nil,
even though Apache 2.0.46 claims to convert "special characters"
to C-style backslashed sequences.