Get-LMAlert
Syntax
Section titled “Syntax”All (Default)
Section titled “All (Default)”Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]Get-LMAlert [-StartDate <datetime>] [-EndDate <datetime>] [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]Get-LMAlert -Id <string> [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]Filter
Section titled “Filter”Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-Filter <Object>] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]FilterWizard
Section titled “FilterWizard”Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-FilterWizard] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]Description
Section titled “Description”The Get-LMAlert function retrieves alerts from LogicMonitor based on specified criteria. It supports filtering by date range, severity, type, and cleared status.
Examples
Section titled “Examples”EXAMPLE 1
Section titled “EXAMPLE 1”#Retrieve alerts from the last 7 daysGet-LMAlert -StartDate (Get-Date).AddDays(-7) -Severity "Error"EXAMPLE 2
Section titled “EXAMPLE 2”#Retrieve a specific alert with custom columnsGet-LMAlert -Id 12345 -CustomColumns "Column1","Column2"Parameters
Section titled “Parameters”-BatchSize
Section titled “-BatchSize”The number of results to return per request. Must be between 1 and 1000. Defaults to 1000.
Type: System.Int32DefaultValue: 1000SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-ClearedAlerts
Section titled “-ClearedAlerts”Whether to include cleared alerts. Defaults to $false.
Type: System.Nullable`1[System.Boolean]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-CustomColumns
Section titled “-CustomColumns”Array of custom column names to include in the results.
Type: System.String[]DefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-EndDate
Section titled “-EndDate”The end date for retrieving alerts. Defaults to current time.
Type: System.DateTimeDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Range Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-Filter
Section titled “-Filter”A filter object to apply when retrieving alerts. Part of a mutually exclusive parameter set.
Type: System.ObjectDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Filter Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-FilterWizard
Section titled “-FilterWizard”Switch to use the filter wizard interface. Part of a mutually exclusive parameter set.
Type: System.Management.Automation.SwitchParameterDefaultValue: FalseSupportsWildcards: falseAliases: []ParameterSets:- Name: FilterWizard Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The specific alert ID to retrieve. This parameter is part of a mutually exclusive parameter set.
Type: System.StringDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Id Position: Named IsRequired: true ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-Severity
Section titled “-Severity”The severity level to filter alerts by. Valid values are "", “Warning”, “Error”, “Critical”. Defaults to "".
Type: System.StringDefaultValue: '*'SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The field to sort results by. Defaults to “+resourceId”.
Type: System.StringDefaultValue: +resourceIdSupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''-StartDate
Section titled “-StartDate”The start date for retrieving alerts. Defaults to 0 (beginning of time).
Type: System.DateTimeDefaultValue: ''SupportsWildcards: falseAliases: []ParameterSets:- Name: Range Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''The type of alerts to retrieve. Valid values are "", “websiteAlert”, “dataSourceAlert”, “eventAlert”, “logAlert”. Defaults to "".
Type: System.StringDefaultValue: '*'SupportsWildcards: falseAliases: []ParameterSets:- Name: (All) Position: Named IsRequired: false ValueFromPipeline: false ValueFromPipelineByPropertyName: false ValueFromRemainingArguments: falseDontShow: falseAcceptedValues: []HelpMessage: ''CommonParameters
Section titled “CommonParameters”This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.