Iis

Log Parser

Select IIS log entries between timeframes.

http://weblogs.asp.net/steveschofield/archive/2008/01/21/log-parser-select-iis-log-entries-between-timeframes.aspx

'Change the location of files right after the timeframe.'Change the location of files right after the timeframe. Displays in the command window

logparser "select date,time,cs-uri-stem,cs-uri-query,sc-status,time-taken from c:\iislogs\w3svc1\ex080109.log where to_time(time) between timestamp('01/01 16:35:00', 'MM/dd hh:mm:ss') and timestamp('01/01 16:40:00', 'MM/dd hh:mm:ss')" -rtp:-1

'Change the location of files right after the timeframe with a particular status code of 500 and pipe to an external file
logparser "select date,time,cs-uri-stem,cs-uri-query,sc-status,time-taken from c:\iislogs\w3svc1\ex080109.log where to_time(time) between timestamp('01/01 16:35:00', 'MM/dd hh:mm:ss') and timestamp('01/01 16:40:00', 'MM/dd hh:mm:ss') and sc-status = 500" -rtp:-1 > filename.txt

Examples

http://www.codinghorror.com/blog/archives/000369.html

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License