Srinivas Sampath

from t in myThoughts where myThoughts.Thoughts = "Technology" select t

October 2004 - Posts

IIS 6.0 LogParser Utility

Recently, we had a product requirement that had us digging into IIS logs. Basically, the requirement was to generate some useful reports off the logs that IIS generates. For example, most of our clients are interested in knowing what browsers the users of their application are using, since they want to target snazzy features based on the browser that is making the request. There are many commercial tools out there that can help make sense of the logs, but nothing is more pleasing than writing your own.

So we started off exploring what Windows 2003 IIS 6.0 has to offer and we came across the IIS 6.0 resource kit. There are many useful utilities in this resource kit, but the one that we required for our work was called LOG PARSER. This is a command line utility that can read all the 6 log formats of IIS 6.0 and provide various reports of interest. LOG PARSER is a very versatile utility in that, it allows you to query the log files using a syntax very similar to T-SQL. In fact, you will not know the difference, unless you look real hard! You have various functions that can extract portions of the URL etc.

The best thing is the various output formats that log parser supports. You have options from CSV to XML! XML is a very interesting option, since it allows you to supply an associated XSL to render the output in various formats that you need.

If you really have a need to monitor your web server logs and generate useful reports off them, don't miss looking at this tool.

Have to Blog!!
Been off from blogging for a long time now. My official commitments are keeping me very busy. This coupled with a new arrival in my family (a baby boy), has me concentrating a lot on taking care of my day-to-day life. But, I've now set an internal goal that I will blog once a week. This should help me consolidate my work and thoughts on a regular basis.