Last active
October 30, 2018 11:25
-
-
Save brianvanderlugt/987e4447e65afb3e88a89d4373199bcf to your computer and use it in GitHub Desktop.
Parsing Storage Logging logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-LogsParsed{ | |
param( | |
[Parameter(Mandatory,ValueFromPipeline=$true)] | |
[String]$Path | |
) | |
PROCESS{ | |
Import-Csv -Path $Path -Delimiter ';' -Header @( | |
'version-number' | |
,'request-start-time' | |
,'operation-type' | |
,'request-status' | |
,'http-status-code' | |
,'end-to-end-latency-in-ms' | |
,'server-latency-in-ms' | |
,'authentication-type' | |
,'requester-account-name' | |
,'owner-account-name' | |
,'service-type' | |
,'request-url' | |
,'requested-object-key' | |
,'request-id-header' | |
,'operation-count' | |
,'requester-ip-address' | |
,'request-version-header' | |
,'request-header-size' | |
,'request-packet-size' | |
,'response-header-size' | |
,'response-packet-size' | |
,'request-content-length' | |
,'request-md5' | |
,'server-md5' | |
,'etag-identifier' | |
,'last-modified-time' | |
,'conditions-used' | |
,'user-agent-header' | |
,'referrer-header' | |
,'client-request-id' | |
) | foreach{ | |
$currObj = $_ | |
$currObj | | |
Add-Member -MemberType NoteProperty -Name 'IPAddress' -Value $currObj.'requester-ip-address'.Split(':')[0] | |
$currObj | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment