Get-LMLogMessage
Syntax
Section titled “Syntax”Range-Async (Default)
Section titled “Range-Async (Default)”Get-LMLogMessage [-Query <String>] [-Range <String>] [-BatchSize <Int32>] [-MaxPages <Int32>] [-Async] [-ProgressAction <ActionPreference>] [<CommonParameters>]Date-Async
Section titled “Date-Async”Get-LMLogMessage -StartDate <DateTime> -EndDate <DateTime> [-Query <String>] [-BatchSize <Int32>] [-MaxPages <Int32>] [-Async] [-ProgressAction <ActionPreference>] [<CommonParameters>]Date-Sync
Section titled “Date-Sync”Get-LMLogMessage -StartDate <DateTime> -EndDate <DateTime> [-Query <String>] [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Range-Sync
Section titled “Range-Sync”Get-LMLogMessage [-Query <String>] [-Range <String>] [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”The Get-LMLogMessage function retrieves log messages from LogicMonitor based on specified time ranges or date ranges. It supports both synchronous and asynchronous queries with pagination control.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”#Retrieve logs for a specific date rangeGet-LMLogMessage -StartDate (Get-Date).AddDays(-1) -EndDate (Get-Date)Example 2
Section titled “Example 2”#Retrieve logs asynchronously with a custom queryGet-LMLogMessage -Range "1hour" -Query "error" -AsyncParameters
Section titled “Parameters”-StartDate
Section titled “-StartDate”The start date for retrieving log messages. Required for Date parameter sets.
Type: DateTimeParameter Sets: Date-Async, Date-SyncAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-EndDate
Section titled “-EndDate”The end date for retrieving log messages. Required for Date parameter sets.
Type: DateTimeParameter Sets: Date-Async, Date-SyncAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Query
Section titled “-Query”A query string to filter the log messages.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Range
Section titled “-Range”The time range for retrieving log messages. Valid values are “15min”, “30min”, “1hour”, “3hour”, “6hour”, “12hour”, “24hour”, “3day”, “7day”, “1month”. Defaults to “15min”.
Type: StringParameter Sets: Range-Async, Range-SyncAliases:
Required: FalsePosition: NamedDefault value: 15minAccept pipeline input: FalseAccept wildcard characters: False-BatchSize
Section titled “-BatchSize”The number of results to return per request. Must be between 1 and 300. Defaults to 300.
Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: 300Accept pipeline input: FalseAccept wildcard characters: False-MaxPages
Section titled “-MaxPages”The maximum number of pages to retrieve in async mode. Defaults to 10.
Type: Int32Parameter Sets: Range-Async, Date-AsyncAliases:
Required: FalsePosition: NamedDefault value: 10Accept pipeline input: FalseAccept wildcard characters: False-Async
Section titled “-Async”Switch to enable asynchronous query mode.
Type: SwitchParameterParameter Sets: Range-Async, Date-AsyncAliases:
Required: FalsePosition: NamedDefault value: FalseAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Section titled “Inputs”None. You cannot pipe objects to this command.
Section titled “None. You cannot pipe objects to this command.”Outputs
Section titled “Outputs”Returns LogicMonitor.LMLogs objects.
Section titled “Returns LogicMonitor.LMLogs objects.”You must run Connect-LMAccount before running this command. This command is reserver for internal use only.