Log Parser is a powerful little tool that allows you to write SQL-like queries against your IIS log files. (I somewhat think this was a base for Powershell, but maybe that’s just me). You can download Log Parser from Microsoft.
Below are a few Log Parser scripts that I occasionally use on my own website(s) for double checking hit counts, page views, and top IIS errors occurring in the web application.
This is by far only a tiny sample of what you can do with Log Parser and those of you who are data mining fanatics, you can go nuts compiling information against your IIS log files! Have fun!
Don’t forget to change the path to point to your log file(s) directory for the website/web application you are analyzing.
Get hit count on web-resources:
Get page view count on webpages:
Get unique visitors (by ip address):
logparser “SELECT date, count(c-ip) FROM ‘c:\mylogpath\Temporary.txt’ GROUP BY date” -i:w3c -o:datagrid
Get top IIS errors occurring on website/webapplication:
For security-related information on using Log Parser check out this great article from Security Focus.