Dec. 18th, 2014

andrewducker: (Default)
andrewducker: (Default)
Posted because there's no official way of converting IIS W3C logs to PowerShell objects, and the original script I found wasn't quite doing what I wanted.

# Define the location of log files and a temporary file
$LogFolder = "build1:\Logs\iis\W3SVC1\"
$LogFiles = ls "$logFolder\u_ex*.log" #Ensure we only get the correctly formatted log files if there's a mixture of styles

# Logs will store each line of the log files in an array
$Logs = @()
# Skip the comment lines
$LogFiles | % { Get-Content $_ | where {$_ -notLike "#[D,F,S,V]*" } | % { $Logs += $_ } }
# Then grab the first header line, and adjust its format for later
$LogColumns = ( $LogFiles | select -first 1 | % { Get-Content $_ | where {$_ -Like "#[F]*" } } ) `
-replace "#Fields: ", "" -replace "-","" -replace "\(","" -replace "\)",""

$newLine = "`r`n"

$tempCsv = "$($LogColumns[0])$newline$($Logs -join $newline)"

return $tempCsv | ConvertFrom-Csv -Delimiter " "
andrewducker: (slogans)
Nice evening today. I left work at 5:15 and walked across town to Edinburgh's best Indian restaurant, had a delicious meal with Julie, and then went to see The Nutcracker with her.

The design of the sets and costumes was gorgeous, the dancing was great, and the music was...well, presumably you've heard large chunks of The Nutcracker before.

Ballet isn't generally my thing, but it held my attention marvellously for a good hour of the two hour length - and thankfully, that hour was spread out quite a lot. Lots of good moments distributed throughout the whole evening, some lovely little comedic touches from two "monkeys" sitting at the feet of Clara (the young girl whose dream forms the majority of the performance).

It wasn't life-changing, but I am glad I saw it.

April 2025

S M T W T F S
   1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 2223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 23rd, 2025 08:09 am
Powered by Dreamwidth Studios