In the meantime you can play around with these functions.
Sorry about the formatting, this forum software is, well, special. The regex line below is supposed to read:
$hostdRegex = "\[(?<Date>[^ ]+) (?<Time>[^ ]+) (?<Object>'[^']+') (?<ID>[^ ]+) (?<Level>[^ ]+)\] (?<Message>.+)"
function Get-LogObject ($logLine)
{
$hostdRegex = "*** SEE LINE ABOVE ***"
$otherRegex = ""
if ($logLine -match $regex) {
$logObj = New-Object System.Management.Automation.PsObject
foreach ($property in "Date","Time","Object","ID","Level","Message") {
$logObj | Add-Member NoteProperty $property $matches.$property
}
$logObj
}
}
function Get-LogObjects
{
$logObjects = @()
while ($input.movenext()) {
$objects = $input.Current.Entries
foreach ($o in $objects) {
$logObject = Get-LogObject $o
if ($logObject) {
$logObjects += $logObject
}
}
}
$logObjects
}
The functions are not parsing out the dates, but that shouldn't be too hard. Unfortunately this stuff only supports hostd ATM. Other log facilities use different formats for some reason. Anyway, there's a number of ways to improve this so feel free to run with it.
To use it, do something like get-log -key hostd | get-logobjects