Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

finstr searching multiple log files in multiple folders

Posted on 2014-03-20
5
Medium Priority
?
432 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 58

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 39944084
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
ID: 39944093
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 58

Expert Comment

by:Bill Prew
ID: 39944101
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
ID: 39944111
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 58

Expert Comment

by:Bill Prew
ID: 39944130
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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

597 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