« Gaping Void On My Desk | Main | Inbox Zero Nirvana »

September 20, 2006

Analyzing Log Files With Dave Taylor

Remember my previous post about Carl? It was about the set of automated scripts we use to monitor our Lighttpd logs.

In the recent issue of Linux Journal, Dave Taylor, the 26-year veteran of UNIX, shows how to analyze your logs old school:
http://www.linuxjournal.com/article/9168

For me it is always amazing to see how you can get two or three simple UNIX utilities and do a complex task in one command. Pure magic.

I loved the scripts so much that I went to our 1Passwd web server and modified them to query the information I need. Here is a few examples:

This command will print the list of the status codes generated by your server:

awk '{print $9}' lighttpd_access.log | sort | uniq -c | sort -rn

In my case, it displayed and it looks like the server is working OK — there were just three 404 (Page Not Found) errors. I am still not sure how to interpret the 206 code though:

Screenshot 08

Another interesting command is this:

awk '{print $11}' lighttpd_access.log | grep -v 'http://1passwd.com' | sort | uniq -c | sort -rn | head -10

It prints the list of top 10 referrers, excluding the http://1passwd.com itself:
Screenshot 07

The best part about using these commands is how easy it is to change them to do what you need.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/3087162/31463480

Listed below are links to weblogs that reference Analyzing Log Files With Dave Taylor:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Thanks for the positive words about my column! I'm not entirely sure what the error 206 means, but it's definition is referenced in this somewhat cryptic note on the Apache.org site: "apache replies 206 partial content instead of 401"

:-)

Post a comment

If you have a TypeKey or TypePad account, please Sign In