I recently had to analyze how much static data the web server was sending out on a daily basis. We wanted to try to get a sense of what it would cost to host all this static content on the new Amazon Cloudfront CDN (content delivery network).
I knew there had to be something out there, but I didn’t know there was something right in the IIS 6 resource kit called LogParser.
There are a bunch of options in log parser, but the one I thought was way cool was the ability to basically “query” the log. For example:
LogParser “Select count(*), sum(sc-bytes) from d:\logs\w3svc1\ex090922.log where cs-uri-stem like ‘%.jpg’ or cs-uri-stem like ‘%.gif’ or cs-uri-stem like ‘%.swf’ or cs-uri-stem like ‘%.css’ or cs-uri-stem like ‘%.js’ or cs-uri-stem like ‘%.pdf’ or cs-uri-stem like ‘%.png’ or cs-uri-stem like ‘%.cur’”
returns:
