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 \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

One thought on “Logparser and finding information ‘between two times’”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s