Uncategorized

Select date ranges with LogParser

Here’s an addendum to my previous LogParser collection of scripts: how can we filter our IIS logs folder to extract only the events happened in a certain time range?


logparser “select * into 27.5.log from med*.log where to_timestamp(date,time)
between timestamp(‘2008/05/27 10:11:00’, ‘yyyy/MM/dd hh:mm:ss’) and timestamp(‘2008/05/27 10:13:00’, ‘yyyy/MM/dd hh:mm:ss’)”

-i:iisw3c -o:nat -rtp:-1

Note I’m using the to_timestamp conversion to combine date and time fields from the IIS log and compare to the date range I’m interested in.


Carlo

Quote of the day:
The important thing in science is not so much to obtain new facts as to discover new ways of thinking about them. – Sir William Bragg

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.