Skip to content

Get-LMAlertRule

Terminal window
Get-LMAlertRule [-BatchSize <int>] [<CommonParameters>]
Terminal window
Get-LMAlertRule [-Id <int>] [-BatchSize <int>] [<CommonParameters>]
Terminal window
Get-LMAlertRule [-Name <string>] [-BatchSize <int>] [<CommonParameters>]
Terminal window
Get-LMAlertRule [-Filter <Object>] [-BatchSize <int>] [<CommonParameters>]

The Get-LMAlertRule function retrieves alert rules from LogicMonitor based on specified criteria. It can return a single rule by ID or name, or multiple rules using filters.

Terminal window
#Retrieve an alert rule by ID
Get-LMAlertRule -Id 123
Terminal window
#Retrieve an alert rule by name
Get-LMAlertRule -Name "High CPU Usage"
Terminal window
#Retrieve alert rules using a filter
Get-LMAlertRule -Filter $filterObject

The number of results to return per request. Must be between 1 and 1000. Defaults to 1000.

Type: System.Int32
DefaultValue: 1000
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

A filter object to apply when retrieving alert rules. Part of a mutually exclusive parameter set.

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Filter
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The ID of the alert rule to retrieve. Part of a mutually exclusive parameter set.

Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Id
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The name of the alert rule to retrieve. Part of a mutually exclusive parameter set.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Name
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.