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

Optimal way to read big log files

$
0
0

Hey There,

I have multiple servers with 2+ GB log files. I need to search certain string from each logs files and pipe result to another file. For the search I use the following commands:

$script=[ScriptBlock]::Create("Get-Content -Path `"C:\Data\2GBFile.log`" | Select-String -Pattern `" 200 `" -NotMatch | Add-content -Path C:\Temp\Non.200Codes.txt")

Invoke-Command -Computer NameLogServer01 -ScriptBlock $script -AsJob

But this ends to the error message: Exception of type 'System.OutOfMemoryException' was thrown.

Is there anything what can be done?

I miss so much of the pure "find.exe".


Petri


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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