Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $MaxDelay = 5000
- $TimeoutDelay = 30000
- $IISLogPath = "FullLogPath"
- $IISLogFileRaw = [System.IO.File]::ReadAllLines($IISLogPath)
- $headers = $IISLogFileRaw[3].split(" ".ToCharArray(), [System.StringSplitOptions]::RemoveEmptyEntries)
- $headers = $headers | where {$_ -ne "#Fields:"}
- $IISLogFileCSV = Import-Csv -Delimiter " " -Header $headers -Path $IISLogPath
- $IISLogFileCSV = $IISLogFileCSV | where {$_.date -notlike "#*"}
- $timeTaken = $IISLogFileCSV | foreach {$_.$("time-taken")}
- $IISLogFileCSV | where {[int]$_.$("time-taken") -gt $MaxDelay} | Format-Table -AutoSize time, cs-username, cs-uri-stem, time-taken, sc-bytes
- $IISLogFileCSV | where {[int]$_.$("time-taken") -gt $TimeoutDelay} | Format-Table -AutoSize time, cs-username, cs-uri-stem, time-taken, sc-bytes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement