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."
"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.
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.
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.