Writing a log file analyser - oliyh/learning-clojure GitHub Wiki
Have a look at the example file in . Below are a few lines:
131.170.154.29 [30:00:00:33] "GET /icons/people.gif HTTP/1.0" 200 224
www-c1.proxy.aol.com [30:00:00:57] "GET / HTTP/1.0" 200 4889
The format is
IP Address | Response timestamp | Client request | HTTP response code | Response size
AWStats is a free log file analyser that produces simple charts like that below. This can give us some ideas about some stats that would be interesting to see.
The data has been partly parsed and can be read from learning-clojure.stats/raw-stats.
learning-clojure.stats=> (pprint (take 2 (raw-stats)))
({:size "4889",
:response "200",
:version "HTTP/1.0",
:url "/",
:method "GET",
:timestamp "30:00:00:00",
:ip "port11.annex1.naples.net"}
{:size "2624",
:response "200",
:version "HTTP/1.0",
:url "/icons/circle_logo_small.gif",
:method "GET",
:timestamp "30:00:00:02",
:ip "port11.annex1.naples.net"})