You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/alerts/alerts-action-rules.md
+32-27Lines changed: 32 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,29 +54,34 @@ An alert processing rule definition covers several aspects:
54
54
55
55
### Which fired alerts are affected by this rule?
56
56
57
-
Each alert processing rule has a **scope**. A scope is a list of one or more specific Azure resources, or specific resource group, or an entire subscription. The alert processing rule will apply to alerts that fired on resources within that scope.
57
+
**SCOPE**
58
+
Each alert processing rule has a scope. A scope is a list of one or more specific Azure resources, or specific resource group, or an entire subscription. **The alert processing rule will apply to alerts that fired on resources within that scope**.
58
59
59
-
You can also define **filters** to narrow down which specific subset of alerts are affected. The available filters are:
60
+
**FILTERS**
61
+
You can also define filters to narrow down which specific subset of alerts are affected within the scope. The available filters are:
60
62
61
63
***Alert Context (payload)** - the rule will apply only to alerts that contain any of the filter's strings within the [alert context](./alerts-common-schema-definitions.md#alert-context) section of the alert. This section includes fields specific to each alert type.
62
-
***Alert rule id** - the rule will apply only to alerts from a specific alert rule. The value should be the full resource ID, for example "/subscriptions/SUB1/resourceGroups/RG1/providers/microsoft.insights/metricalerts/MY-API-LATENCY".
63
-
You can locate the alert rule ID by opening a specific alert rule in the portal, clicking "Properties", and copying the "Resource ID" value. You can also locate it by listing your alert rules from CLI/PowerShell.
64
+
***Alert rule id** - the rule will apply only to alerts from a specific alert rule. The value should be the full resource ID, for example `/subscriptions/SUB1/resourceGroups/RG1/providers/microsoft.insights/metricalerts/MY-API-LATENCY`.
65
+
You can locate the alert rule ID by opening a specific alert rule in the portal, clicking "Properties", and copying the "Resource ID" value.
66
+
You can also locate it by listing your alert rules from PowerShell or CLI.
64
67
***Alert rule name** - the rule will apply only to alerts with this alert rule name. Can also be useful with a "Contains" operator.
65
68
***Description** - the rule will apply only to alerts that contain the specified string within the alert rule description field.
66
69
***Monitor condition** - the rule will apply only to alerts with the specified monitor condition, either "Fired" or "Resolved".
67
70
***Monitor service** - the rule will apply only to alerts from any of the specified monitor services.
68
71
For example, use "Platform" to have the rule apply only to metric alerts.
69
72
***Resource** - the rule will apply only to alerts from the specified Azure resource.
70
-
This filter is useful with "Does not equal" operator, or with "Contains" / "Does not contain" operators.
73
+
For example, you can use this filter with "Does not equal" to exclude one or more resources when the rule's scope is a subscription.
71
74
***Resource group** - the rule will apply only to alerts from the specified resource groups.
72
-
This filter is useful with "Does not equal" operator, or with "Contains" / "Does not contain" operators.
73
-
***Resource type** - the rule will apply only to alerts on resource from the specified resource types, such as virtual machines.
74
-
***Severity** - the rule will apply only to alerts with the selected severities.
75
+
For example, you can use this filter with "Does not equal" to exclude one or more resource groups when the rule's scope is a subscription.
76
+
***Resource type** - the rule will apply only to alerts on resource from the specified resource types, such as virtual machines. You can use "Equals" to match one or more specific resources, or you can use contains to match a resource type and all its child resources.
77
+
For example, use "contains MICROSOFT.SQL/SERVERS" to match both SQL servers and all their child resources, like databases.
78
+
***Severity** - the rule will apply only to alerts with the selected severities.
75
79
76
-
If you define multiple filters in a rule, all of them apply. For example, if you set **resource type = "Virtual Machines"** and **severity = "Sev0"**, then the rule will apply only for Sev0 alerts on virtual machines in the scope.
77
-
78
-
> [!NOTE]
79
-
> Each filter may include up to five values.
80
+
**FILTERS BEHAVIOR**
81
+
* If you define multiple filters in a rule, all of them apply - there is a logical AND between all filters.
82
+
For example, if you set both `resource type = "Virtual Machines` and `severity = "Sev0`, then the rule will apply only for Sev0 alerts on virtual machines in the scope.
83
+
* Each filter may include up to five values, and there is a logical OR between the values.
84
+
For example, if you set `description contains ["this", "that"]`, then the rule will apply only to alerts whose description contains either "this" or "that".
80
85
81
86
### What should this rule do?
82
87
@@ -140,7 +145,7 @@ You can use the Azure CLI to work with alert processing rules. See the `az monit
140
145
141
146
1.**Sign in**
142
147
143
-
If you're using a local installation of the CLI, sign in using the [az login](/cli/azure/reference-index#az-login) command. Follow the steps displayed in your terminal to complete the authentication process.
148
+
If you're using a local installation of the CLI, sign in using the `az login`[command](/cli/azure/reference-index#az-login). Follow the steps displayed in your terminal to complete the authentication process.
144
149
145
150
```azurecli
146
151
az login
@@ -171,10 +176,10 @@ For example, to create a rule that adds an action group to all alerts in a subsc
--description "Add action group AG1 to all alerts in the subscription"
178
183
```
179
184
180
185
The [CLI documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
@@ -193,10 +198,10 @@ For example, to create a rule that adds an action group to all alerts in a subsc
-Description "Add action group AG1 to all alerts in the subscription"
200
205
```
201
206
202
207
The [PowerShell documentation](/cli/azure/monitor/alert-processing-rule#az-monitor-alert-processing-rule-create) include more examples and an explanation of each parameter.
@@ -224,13 +229,13 @@ Before you manage alert processing rules with the Azure CLI, prepare your enviro
224
229
az monitor alert-processing-rules list
225
230
226
231
# Get details of an alert processing rule
227
-
az monitor alert-processing-rules show --resource-group MyResourceGroupName --name MyRule
232
+
az monitor alert-processing-rules show --resource-group RG1 --name MyRule
228
233
229
234
# Update an alert processing rule
230
-
az monitor alert-processing-rules update --resource-group MyResourceGroupName --name MyRule --status Disabled
235
+
az monitor alert-processing-rules update --resource-group RG1 --name MyRule --status Disabled
231
236
232
237
# Delete an alert processing rule
233
-
az monitor alert-processing-rules delete --resource-group MyResourceGroupName --name MyRule
238
+
az monitor alert-processing-rules delete --resource-group RG1 --name MyRule
234
239
```
235
240
236
241
### [PowerShell](#tab/powershell)
@@ -244,13 +249,13 @@ Before you manage alert processing rules with the Azure CLI, prepare your enviro
0 commit comments