Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Most efficient way to consume log files

$
0
0

Hello everyone,

I've been absent from the forums for awhile but I'm back at it now... 

I have a question about the most efficient way to consume log files.  I read in Powershell in action, by Bruce Payette that using a switch statement with a regex worked pretty well, that being said I haven't tried it yet. Select-string is working pretty well for me but I have about 10 different entry types that I need to search logs for every 5 minutes and I'm scanning about 15 GB of logs at every interval.  Anyway, if anyone has information about how to do something like that as quickly as possible I'd appreciate it.

1.  piping log files that meet my criteria to select-string

   - This seems to work well but I don't like searching the same files over and over again

2. running logs through get-content and then building a filter statement

  - This is ok but it seems to use up a fair bit of memory

3. Some other approach that I haven't thought of yet.

Anyway, I know this is a relatively nebulous question, sorry about that.  I'm hoping that someone on here knows a really good way to find strings in logs files quickly.


Hope that helps! Jason


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>