Monday, March 26, 2007
The coolest log parser
Once again Microsoft has come up with an awesome and very smart utility called Log Parser. It uses SQL-like syntax to allow you to query many kinds of sources. Example sources are web logs from IIS, EventLog in Windows, Active Directory, LDAP, etc.
Here is how I got hits on a specific page in my application by month:
LogParser "SELECT TO_STRING(date, 'yyyy-MM') as MONTH, COUNT(*) AS Hits FROM <FrontLine> where cs-uri-stem = '/KnowledgeBase.aspx' GROUP BY TO_STRING(date, 'yyyy-MM'), cs-uri-stem ORDER BY TO_STRING(date, 'yyyy-MM') DESC"
In case that wasn't cool enough, you can output results to a chart (file), Database, Excel, etc.
Here is where you can get the latest binary from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en
Here is a good example for web logs usage:
http://geekswithblogs.net/woodenshoe/archive/2005/09/17/54194.aspx
Here is how to use it from C#:
http://www.codeproject.com/csharp/SimpleLogParse.asp
This seems to be a good tutorial:
http://www.microsoft.com/technet/community/columns/scripts/sg0105.mspx
Subscribe to:
Post Comments (Atom)
1 comment:
There are lot of parsing methods are available. This post describes the coolest log parser in detail. I am very impresses with your work. Parsing is not easy method but your post help a lot in learning them. Thanks for your post.
Post a Comment