I am getting consistently pinged from our government contract holder to search for IP addresses in our logs. I have three firewalls, 30 plus servers, etc so you can imagine how unwieldy it becomes. To amplify the problem, I have been provided a list of over 1500 IP addresses for which I am to search all log files...
I have all of the logs downloaded and can use powershell to go through them one by one but it takes forever. I need to be able to run the search using multi-thread in Powershell but cannot figure out the logic to do so. Here's my one by one script...
Any help would be appreciated!
$log = (import-csv C:empFWLogsIPSearch.csv)
$ip = ($log.IP)
ForEach($log in $log){ Get-ChildItem -Recurse -path C:empFWLogs -filter *.log | Select-String $ip -List | Select Path
}
question from:
https://stackoverflow.com/questions/65908671/need-to-parse-thousands-of-files-for-thousands-of-results-prefer-powershell 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…