Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

When I need to generate random http stats, I usually install analog. http://www.analog.cx/ 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. http://www.hping.org/visitors/

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 10.10.10.1|172.10.10.1|-|[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
add comment

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
add comment

Your Answer

 
discard

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.