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

by rahul 1/22/2014 8:48:05 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
Rahul


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

Tags: ,

Logparser | Tips and Tricks | Troubleshooting

blog comments powered by Disqus

Who is Rahul?

Rahul

He works for Microsoft and likes Software & Gadgets!

He shares some interesting notes here while working with stuff that excites him.

Disclaimer

The opinions expressed herein are our own personal opinions and do not represent our employer's view in any way.
© Copyright 2014, Rahul Soni