Get-LMAlertRule
Syntax
Section titled “Syntax”All (Default)
Section titled “All (Default)”Get-LMAlertRule [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Get-LMAlertRule [-Id <Int32>] [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Get-LMAlertRule [-Name <String>] [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Filter
Section titled “Filter”Get-LMAlertRule [-Filter <Object>] [-BatchSize <Int32>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”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.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”#Retrieve an alert rule by IDGet-LMAlertRule -Id 123Example 2
Section titled “Example 2”#Retrieve an alert rule by nameGet-LMAlertRule -Name "High CPU Usage"Example 3
Section titled “Example 3”#Retrieve alert rules using a filterGet-LMAlertRule -Filter $filterObjectParameters
Section titled “Parameters”The ID of the alert rule to retrieve. Part of a mutually exclusive parameter set.
Type: Int32Parameter Sets: IdAliases:
Required: FalsePosition: NamedDefault value: 0Accept pipeline input: FalseAccept wildcard characters: FalseThe name of the alert rule to retrieve. Part of a mutually exclusive parameter set.
Type: StringParameter Sets: NameAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Filter
Section titled “-Filter”A filter object to apply when retrieving alert rules. Part of a mutually exclusive parameter set.
Type: ObjectParameter Sets: FilterAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-BatchSize
Section titled “-BatchSize”The number of results to return per request. Must be between 1 and 1000. Defaults to 1000.
Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: NamedDefault value: 1000Accept 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.AlertRule objects.
Section titled “Returns LogicMonitor.AlertRule objects.”You must run Connect-LMAccount before running this command.