finstr searching multiple log files in multiple folders

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
rutgermonsAsked:
Who is Participating?
 
Bill PrewConnect With a Mentor Commented:
You can search all subfolders with the /S switch, so something like this:

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

~bp
0
 
rutgermonsAuthor Commented:
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
 
Bill PrewCommented:
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
 
rutgermonsAuthor Commented:
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
 
Bill PrewCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.