Logparser Scenario 11:Find out the information from IIS Log files for the last x minutes

by Rahul 1/22/2014 8:48:00 AM

You are troubleshooting a weird scenario in your IIS farm, and realize that you want to open your IIS Log files to see the latest set of entries. You would typically end up double clicking an IIS Log file and go to the end of the file to see what you are looking for. Then you realize, jeez... it isn't live! i.e... the newest entries are still being made but not visible in notepad. So, you close the file and repeat! Frustrating... right?

Let's put logparser to action.

Logparser "select to_localtime(time), cs-uri-stem from '\\servername\path\LOGFILE_NAME.log' where TIME > SUB(SYSTEM_TIME(), TO_TIMESTAMP('00:15:00','hh:mm:ss'))" -i:IISw3c -rtp:-1

This will give you the information only for the last 15 minutes. You can tweak the TO_TimeStamp function to get the information for the time duration that works for you.

Hope this helps, Wave

Quote of the day:
"Nothing shocks me. I'm a scientist." - Harrison Ford

Tags: , , , ,

IIS | Log Parser | Tips and Tricks | Troubleshooting | Web Server

blog comments powered by Disqus