Solved

finstr searching multiple log files in multiple folders

Posted on 2014-03-20
5
409 Views
Last Modified: 2014-03-21
folks

how can I use the "findstr" command to search for a specific string in multiple sub folders
on a server?

the below works when looking at one file but I would like to view various log files for "bloggs"

outputting the log file name would also assist

hope anyone can assist
0
Comment
Question by:rutgermons
  • 3
  • 2
5 Comments
 
LVL 51

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
You can search all subfolders with the /S switch, so something like this:

findstr /s /i /c:"bloggs" d:\base\*.txt

~bp
0
 

Author Comment

by:rutgermons
Comment Utility
cool

so, in essence your main folder is called "base" right?

i addition is there  a switch that checks for the string after a certain timstamp in the logs?
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
Correct on "base", all files in that folder, and all subfolders of it will be searched.

FINDSTR can use regular expressions as search strings, but no easy way to use that to start a search after a date or time in the file.

~bp
0
 

Author Comment

by:rutgermons
Comment Utility
Ok, lastly, is there a switch to be able to look at multiple servers?

i have the same log folder setup over different servers so such a switch could assist me in troubleshooting for specific errors

cheers
0
 
LVL 51

Expert Comment

by:Bill Prew
Comment Utility
No, but just put several lines like the example in a BAT script and change the base folder as needed for each server.

~bp
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now