Solved

finstr searching multiple log files in multiple folders

Posted on 2014-03-20
5
424 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 55

Accepted Solution

by:
Bill Prew earned 500 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 55

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 55

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

696 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