Jan 20, 2010

Microsoft Log Parser

This is a tool that provides query access to text-based data such as log files, XML/CVS files, as well as Event Log, the Registry, the file system and Active Directory.
Download here.
Here is a sample query that returns the top bandwidth by URL

SELECT top 50 DISTINCT 
SUBSTR(TO_LOWERCASE(cs-uri-stem), 0, 55) AS Url, 
Count(*) AS Hits, 
AVG(sc-bytes) AS AvgBytes, 
SUM(sc-bytes) as ServedBytes 
FROM {filename} 
GROUP BY Url 
HAVING Hits >= 20 
ORDER BY ServedBytes DESC

So at the command line run:
logparser -i:iiswc3 "SELECT STATEMENT GOES HERE"

Here are some links to example queries:
LogParserPlus Queries
ServerFault IIS Queries
Tutorial
IIS Forum

No comments:

Post a Comment