Skip to content

Instantly share code, notes, and snippets.

@dhcgn
Created September 1, 2016 08:14
Show Gist options
  • Save dhcgn/1610db75d2e2f02e7e4b0c089a4ee584 to your computer and use it in GitHub Desktop.
Save dhcgn/1610db75d2e2f02e7e4b0c089a4ee584 to your computer and use it in GitHub Desktop.
gci C:\inetpub\logs\LogFiles | # Get all sites
%{ gci $_.FullName | Sort-Object LastWriteTime | select -Last 1 } | # Get the last log file from each site
?{$_.LastWriteTime -gt (Get-Date).Date} | # only files from today
Get-Content -Tail 5 | # get the last lines
Select-String -Pattern 'POST' | # only method POST
Sort-Object # sort ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment