Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Name

Get-JobSchedulerOrderLog

SYNOPSIS

Read the order log from the JobScheduler History.

...

Get-JobSchedulerOrderLog [[-HistoryId] <String> ] [ [-OrderId] <String> ] [[-JobChain] <String> ] [[-Path] <String>] [[-Node] <String[]><String>] [[-StartTime] <DateTime>] [[-EndTime] <DateTime>] [[-ExitCode] <int><Int32>] [[-State] <PSCustomObject><PSObject>] [[-JobSchedlerIDJobSchedulerId] <String>] [<CommonParameters>]

...

Reads an order log for a given job chain, order ID and history ID. This cmdlet is mostly used for pipelined input from the
Get-JobScchedulerOrderHistory JobSchedulerOrderHistory cmdlet that allows to search the execution history of orders and
that returns history IDs that are used by this cmdlet to retrieve the ordersorder's log output.

PARAMETERS

HistoryId

-HistoryId <String>
Specifies the history ID that the order was running for. This information is provided by the
Get-JobSchedulerOrderHistory cmdlet.

Required?true
Position?1
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

OrderId

-OrderId <String>
This parameter specifies the order that was running for the given history ID.

Required?true
Position?2
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

...

-JobChain <String>
This parameter specifies the job chain path that the order is assigned. One of the parameters -Directory or -JobChain has to be specified.

Required?true
Position?3
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Path

-Path <String>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?4
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Node

-Node <String>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?5
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

StartTime

-StartTime <DateTime>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?6
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

EndTime

-EndTime <DateTime>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?7
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

ExitCode

-ExitCode <int><Int32>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?8
Default value0
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

State

-State <PSCustomObject><PSObject>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?9
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

JobSchedulerId

-JobSchedulerId <String>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?10
Default value
(Get-Timezone -Id 'UTC')
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

about_jobschedulerJobScheduler

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > Get> Get-JobSchedulerOrderHistory -JobChain /product_demo/shell_chain | Get-JobSchedulerOrderLog

...

-------------------------- EXAMPLE 2 --------------------------

PS > Get> Get-JobSchedulerOrderHistory -JobChain /product_demo/shell_chain | Get-JobSchedulerOrderLog | Out-File /tmp/shell_chain.log -Encoding Unicode

...

-------------------------- EXAMPLE 3 --------------------------

PS > Get> Get-JobSchedulerOrderHistory -RelativeDateFrom -8h | Get-JobSchedulerOrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.jobChain))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content

...

-------------------------- EXAMPLE 4 --------------------------

PS > # > # execute once
PS > $lastHistory $lastHistory = Get-JobSchedulerOrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime
PS > # # execute by interval
PS > GetGet-JobSchedulerOrderHistory -DateFrom $lastHistory[0].startTime | Tee-Object -Variable lastHistory | Get-JobSchedulerOrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.jobChain))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content

Provides a mechanism to subsequently retrieve previous logs. Starting from initial execution of the Get-JobSchedulerOrderHistory cmdlet the resulting $lastHistory object is used for any subsequent calls.
Consider use of the Tee-Object cmdlet in the pipeline that updates the $lastHistory object that can be used for later executions of the same pipeline.
The pipeline can e.g. be executed in a cyclic job.