Search for Word Strings in IIS Log Files
by admin on Apr.09, 2008, under Software, Systems
What do you do if you want to look for combinations of word strings in Gigabytes of IIS log files but don’t want to spend any money?
You download a program called Strings.
This is a SysInternals program now owned by Microsoft that will search through text files for word strings and kick them out to you.
So I will go through an example of how you can use it and you can modify it from there.
So copy all of the IIS log files to a location, for example c:\logs
Then open up a command prompt, go to the directory where you have the strings program.
Type the command: strings.exe -s c:\logs | findstr “Your Search Text”
This will dump all the lines it finds with that search text to your command prompt window. Now take it further.
Type the command: strings.exe -s c:\logs | findstr “Your Search Text” > c:\output\log.txt
That will dump the found lines to a new text file. Either you can use that text file for whatever you want or parse it down further with the following.
Type the command: strings.exe -s c:\output | findstr “Your Search Text 2″
That will allow you to search through huge directories of IIS logs for combinations of things. If you do the same search often try dumping it into a batch file.