Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone have a script with awk that can be used for parsing through apache logs to return quick stats?

share|improve this question
What stats do you want? # unique IPs? – DerfK Mar 24 '11 at 23:01
Yes - but I don't keep them - I just write what I need at the time. Thats kind of the point of awk! For more general stuff I use awstats – symcbean Mar 24 '11 at 23:51

What kind of stats? Specify it.
You could take a look on awstats

share|improve this answer
As an example the log format used is as follows: – Neeraj Mar 24 '11 at 22:41
Based on the above format and example log, how can I find teh urls that are taking longer than n seconds. Say 10 seconds. – Neeraj Apr 9 '11 at 2:56

When I need to generate random http stats, I usually install analog. it's been around for over 15 years and can do simple or complex stuff, very efficiently.

"visitors" looks interesting, although I haven't tried it yet.

share|improve this answer
I need some example awk scripts which I can use because I dont have the ability to install any software on the server. LogFormat "%h|%{client-ip}i|%u|%t|%P|\"%r\"|\"%{Referer}i\"|s:%>s|%b|%T" – Neeraj Mar 24 '11 at 22:39
Test log is as follows||-|[24/Mar/2011:18:43:18 -0400]|31597|"POST /someproxy/SomeServlet?to=domain/ab/api/som.ashx HTTP/1.1"|"somedomain/app/link/page.html?query=F"|s:200|2|15 – Neeraj Mar 24 '11 at 22:44
You could install software, and copy logs, to another system (maybe a VM on your laptop or something). – Robert Novak Jun 9 '11 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.