Skip to content

Instantly share code, notes, and snippets.

@jincod
Created February 6, 2016 15:47
Show Gist options
  • Save jincod/eee712faa93e649c2ec3 to your computer and use it in GitHub Desktop.
Save jincod/eee712faa93e649c2ec3 to your computer and use it in GitHub Desktop.
Powershell script for find and calculate urls with max errors
gci | Select-String "\s502\s|\s504\s" | %{$_ -match 'GET (.*) HTTP/1.1'} | foreach { $matches[1] }| group-object -noelement | Where-Object {$_.Name -notlike "*solr*"} | Sort-Object Count -Descending | % {"{0} {1}" -f $_.Count, $_.Name} | Out-File result.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment