Export (0) Print
Expand All
4 out of 19 rated this helpful - Rate this topic

Log Parser Examples

Published: January 19, 2005

These examples show Log Parser searching for data, creating reports, and calculating statistics.  These are just three of the innumerable ways this versatile tool can make your life easier.  Maybe you'll be the next to discover a new and cool way to use Log Parser!

On This Page

Search for Data
Create Reports
Calculate Statistics


Search for Data

Search for the logons of a specific user among the events in the Windows Event Log:


C:\>LogParser "SELECT TimeGenerated, SourceName, 
EventCategoryName, Message INTO report.txt FROM Security WHERE 
EventID = 528 AND SID LIKE '%TESTUSER%'" -resolveSIDs:ON


And obtain results in a text file formatted as desired:

Lpexam01.gif

Create Reports

Create custom-formatted HTML reports:

Lpexam02.gif

Calculate Statistics

Calculate the distribution of the HTTP response status codes from your IIS log files:


C:\>LogParser "SELECT sc-status, COUNT(*) AS Times INTO Chart.gif 
FROM <1> GROUP BY sc-status ORDER BY Times DESC" -
chartType:PieExploded3D -chartTitle:"Status Codes"


And produce a chart formatted as desired:

Lpexam03.gif

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.