Logparser and finding information 'between two times'

Tags: Logparser

I'm finding working with Logparser and dates is a bit involved.   Here is a query I used to extract files between two times stored in W3SVC logs.

logparser "select date,time,cs-uri-stem,sc-status,count(*) into out.txt from \Serverwwwlogsw3svcXXXXX61220.log WHERE TO_TIME(time) BETWEEN TIMESTAMP('01/01 13:50:00', 'MM/dd hh:mm:ss') ANDTIMESTAMP('01/01 18:30:00', 'MM/dd hh:mm:ss') AND SC-STATUS = 500 group by cs-uri-stem, date,time,sc-status order by count(*) DESC" -o:csv

3 Comments

Add a Comment