Logparser and finding information 'between two times'

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 \\Server\wwwlogs\w3svcXXXXX\061220.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

Published Wednesday, December 20, 2006 7:06 PM by steve schofield
Filed under:

Comments

# re: Logparser and finding information 'between two times'

Tuesday, September 11, 2007 6:51 AM by Serious

Great job, works fine - many thx