Advertisement
guyrleech

Filtering today's IIS log into sortable/filterable grid view

Feb 25th, 2020 (edited)
1,215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Get-Content -Path "$env:SystemDrive:\inetpub\logs\logfiles\w3svc1\$(Get-Date -Format 'u_exyyMMdd.lo\g')"|Where-Object { $_ -match '^(\d|#Fields)' } | ForEach-Object { $_ -replace '^#Fields: ' } |ConvertFrom-Csv -Delimiter ' '|Where-Object date -ine 'date' |Select-Object -Property @{n='DateTime';e={$script:timestamp = [datetime]"$($_.date) $($_.time)";$script:timestamp}},@{n='LocalTime';e={$script:timestamp.ToLocalTime()}},*,@{name='Duration';expression={([int]$_.'time-taken')}} -Exclude date,time,'time-taken'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement