Logparser Scenario 6:Searching files for culprits when you don't have Visual Studio on the Server

by Rahul 7/15/2008 9:55:12 PM

This post is a continuation of this article.

Scenario 6: Searching for any specific text in all the files of a folder.

A small background of the problem
Recently we saw a very interesting problem. Users of a web-site were seeing other user's data in ASP.NET. There is cool blog entry about it by Jerry Orman where he talks about how to go about troubleshooting these issues. The Step 2 in his entry mentions about use of Caching. The customer didn't have much idea about the code (although it was present on the Server along with the aspx files) and was unable to answer whether they were using Caching or Static stuff in their code. We could have checked it easily, but they had about 2000+ pages in quite a few folders!!! Add to the problems, we didn't have VS installed on the server. The problem was now to see IF AT ALL they are using Caching or Static in their pages. I don't really trust Windows Search so I typically use Log Parser.

Answer: Open the Log Parser command window, and use the following command:
LOGPARSER "Select Text from 'C:\Code Folder\*.*' where Text like '%cache%'" -i:TEXTLINE

So, if you have any files containing the word Cache you will soon see something like this...

Text
-------------------
<%@OutputCache Duration="60" VaryByParam="none" %> 
<%@OutputCache Duration="60" VaryByParam="none" %>
Statistics:
-----------
Elements processed: 234224
Elements output:    2
Execution time:     5.02 seconds

NOTE> This will only search in the Code Folder and not the subfolders.
If you don't find any line containing "%cache%" you will get something like...

Statistics:
-----------
Elements processed: 254442
Elements output:    0
Execution time:     5.88 seconds

In our case we were lucky, since we saw quite a few pages which had OutputCache directive. We discussed about it with the developers and came to know that among them there were a few .ascx pages which were causing this session sharing issue. Anyway, that's a different story altogether Happy

To know more about how to troubleshoot these kind of issues, I would suggest you to go through Jerry's blog mentioned above.

Cheers,
Rahul



blog comments powered by Disqus

Comments

Search


Tags



Categories

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

All Items
Sign in

Disclaimer

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

Powered by BlogEngine.NET 1.4.5.0