Skip to content

Commit fda18b5

Browse files
authored
Merge pull request #186115 from yanivlavi/lsagaapichanges2
Made updates to log alerts doc post GA
2 parents 9ab1404 + f7bab61 commit fda18b5

File tree

5 files changed

+39
-92
lines changed

5 files changed

+39
-92
lines changed

articles/azure-monitor/alerts/alerts-log-api-switch.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
---
2-
title: Upgrade to the current Azure Monitor Log Alerts API
3-
description: Learn how to switch to the log alerts ScheduledQueryRules API
2+
title: Upgrade legacy rules management to the current Azure Monitor Log Alerts API
3+
description: Learn how to switch to the log alerts management to ScheduledQueryRules API
44
author: yanivlavi
55
ms.author: yalavi
66
ms.topic: conceptual
7-
ms.date: 09/22/2020
7+
ms.date: 01/25/2022
88
---
9-
# Upgrade to the current Log Alerts API from legacy Log Analytics Alert API
9+
# Upgrade legacy rules management to the current Log Alerts API from legacy Log Analytics Alert API
1010

1111
> [!NOTE]
1212
> This article is only relevant to Azure public (**not** to Azure Government or Azure China cloud).
1313
1414
> [!NOTE]
15-
> Once a user chooses to switch preference to the current [scheduledQueryRules API](/rest/api/monitor/scheduledqueryrule-2021-02-01-preview/scheduled-query-rules) it is not possible to revert back to the older [legacy Log Analytics Alert API](./api-alerts.md).
15+
> Once a user chooses to switch rules with legacy management to the current [scheduledQueryRules API](/rest/api/monitor/scheduledqueryrule-2021-02-01-preview/scheduled-query-rules) it is not possible to revert back to the older [legacy Log Analytics Alert API](./api-alerts.md).
1616
17-
In the past, users used the [legacy Log Analytics Alert API](./api-alerts.md) to manage log alert rules. Current workspaces use [ScheduledQueryRules API](/rest/api/monitor/scheduledqueryrule-2021-02-01-preview/scheduled-query-rules). This article describes the benefits and the process of switching from the legacy API to the current API.
17+
In the past, users used the [legacy Log Analytics Alert API](./api-alerts.md) to manage log alert rules. Currently workspaces use [ScheduledQueryRules API](/rest/api/monitor/scheduledqueryrule-2021-08-01/scheduled-query-rules) for new rules. This article describes the benefits and the process of switching legacy log alert rules management from the legacy API to the current API.
1818

1919
## Benefits
2020

21+
- Manage all log rules in one API.
2122
- Single template for creation of alert rules (previously needed three separate templates).
2223
- Single API for all Azure resources log alerting.
23-
- Support for stateful and 1-minute log alert previews.
24-
- [PowerShell cmdlets support](./alerts-manage-alerts-previous-version.md#manage-log-alerts-using-powershell).
25-
- Alignment of severities with all other alert types.
26-
- Ability to create [cross workspace log alert](../logs/cross-workspace-query.md) that span several external resources like Log Analytics workspaces or Application Insights resources.
27-
- Users can specify dimensions to split the alerts.
28-
- Log alerts have extended period of up to two days of data (previously limited to one day).
24+
- Support for stateful and 1-minute log alert previews for legacy rules.
25+
- [PowerShell cmdlets](./alerts-manage-alerts-previous-version.md#manage-log-alerts-using-powershell) and [Azure CLI](./alerts-log.md#manage-log-alerts-using-cli) support for switched rules.
26+
- Alignment of severities with all other alert types and newer rules.
27+
- Ability to create [cross workspace log alert](../logs/cross-workspace-query.md) that span several external resources like Log Analytics workspaces or Application Insights resources for switched rules.
28+
- Users can specify dimensions to split the alerts for switched rules.
29+
- Log alerts have extended period of up to two days of data (previously limited to one day) for switched rules.
2930

3031
## Impact
3132

32-
- All new rules must be created/edited with the current API. See [sample use via Azure Resource Template](alerts-log-create-templates.md) and [sample use via PowerShell](./alerts-manage-alerts-previous-version.md#manage-log-alerts-using-powershell).
33+
- All switched rules must be created/edited with the current API. See [sample use via Azure Resource Template](alerts-log-create-templates.md) and [sample use via PowerShell](./alerts-manage-alerts-previous-version.md#manage-log-alerts-using-powershell).
3334
- As rules become Azure Resource Manager tracked resources in the current API and must be unique, rules resource ID will change to this structure: `<WorkspaceName>|<savedSearchId>|<scheduleId>|<ActionId>`. Display names of the alert rule will remain unchanged.
3435

3536
## Process

articles/azure-monitor/alerts/alerts-log.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Use Azure Monitor to create, view, and manage log alert rules
44
author: AbbyMSFT
55
ms.author: abbyweisberg
66
ms.topic: conceptual
7-
ms.date: 12/14/2021
7+
ms.date: 01/25/2022
88
ms.custom: devx-track-azurepowershell, devx-track-azurecli
99
---
1010
# Create, view, and manage log alerts using Azure Monitor
@@ -26,7 +26,6 @@ You can also [create log alert rules using Azure Resource Manager templates](../
2626
> This article describes creating alert rules using the new alert rule wizard. Please note these changes in the new alert rule experience:
2727
> - Search results are not included with the triggered alert and its associated notifications. The alert contains a link to the search results in Logs.
2828
> - The new alert rule wizard does not include the option to customize the triggered alert's email or to include a custom JSON payload.
29-
> - The new alert rule wizard does not currently support a frequency of 1 minute. 1 minute alert frequency will be supported soon.
3029
3130
1. In the [portal](https://portal.azure.com/), select the relevant resource.
3231
1. In the Resource menu, under **Monitoring**, select **Alerts**.

articles/azure-monitor/alerts/alerts-troubleshoot-log.md

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Common issues, errors, and resolutions for log alert rules in Azure
44
author: yanivlavi
55
ms.author: yalavi
66
ms.topic: conceptual
7-
ms.date: 12/08/2021
7+
ms.date: 01/25/2022
88
ms.custom: devx-track-azurepowershell
99

1010
---
@@ -27,19 +27,11 @@ Logs are semi-structured data and are inherently more latent than metrics. If yo
2727

2828
To mitigate latency, the system retries the alert evaluation multiple times. After the data arrives, the alert fires, which in most cases don't equal the log record time.
2929

30-
### Incorrect query time range configured
30+
### Actions are muted or alert rule is defined to resolve automatically
3131

32-
Query time range is set in the rule condition definition. For workspaces and Application Insights, this field is called **Period**. For all other resource types, it's called **Override query time range**. Like in log analytics, the time range limits query data to the specified period. Even if the **ago** command is used in the query, the time range will apply.
32+
Log alerts provide an option to mute fired alert actions for a set amount of time using **Mute actions** and to only fire once per condition being met using **Automatically resolve alerts**.
3333

34-
For example, a query scans 60 minutes when the time range is 60 minutes, even if the text contains **ago(1d)**. The time range and query time filtering need to match. In the example case, changing the **Period** / **Override query time range** to one day, works as expected.
35-
36-
![Time period](media/alerts-troubleshoot-log/LogAlertTimePeriod.png)
37-
38-
### Actions are muted in the alert rule
39-
40-
Log alerts provide an option to mute fired alert actions for a set amount of time. In workspaces and Application Insights, this field is called **Suppress alerts**. In all other resource types, it's called **Mute actions**.
41-
42-
A common issue is that you think that the alert didn't fire the actions because of a service issue, even though it was muted by the rule configuration.
34+
A common issue is that you think that the alert didn't fire, but it was actually the rule configuration.
4335

4436
![Suppress alerts](media/alerts-troubleshoot-log/LogAlertSuppress.png)
4537

@@ -67,31 +59,6 @@ Log alerts work best when you try to detect data in the logs. It works less well
6759

6860
There are built-in capabilities to prevent false alerts, but they can still occur on very latent data (over ~30 minutes) and data with latency spikes.
6961

70-
### Query optimization issues
71-
72-
The alerting service changes your query to optimize for lower load and alert latency. The alert flow was built to transform the results that indicate the issue to an alert. For example, in a case of a query like:
73-
74-
``` Kusto
75-
SecurityEvent
76-
| where EventID == 4624
77-
```
78-
79-
If the intent of the user is to alert, when this event type happens, the alerting logic appends `count` to the query. The query that will run is:
80-
81-
``` Kusto
82-
SecurityEvent
83-
| where EventID == 4624
84-
| count
85-
```
86-
87-
There's no need to add alerting logic to the query, and doing that may even cause issues. In the preceding example, if you include `count` in your query, it always results in the value **1**, because the alert service performs a `count` of `count`.
88-
89-
The log alert service runs the optimized query. You can run the modified query in the Log Analytics [portal](../logs/log-query-overview.md) or [API](/rest/api/loganalytics/).
90-
91-
For workspaces and Application Insights, it's called **Query to be executed** in the Condition pane. In all other resource types, select **See final alert Query** on the **Condition** tab.
92-
93-
![Query to be executed](media/alerts-troubleshoot-log/LogAlertPreview.png)
94-
9562
## Log alert was disabled
9663

9764
The following sections list some reasons why Azure Monitor might disable a log alert rule. After those section, there's an [example of the activity log that is sent when a rule is disabled](#activity-log-example-when-rule-is-disabled).
@@ -137,7 +104,7 @@ If you've reached the quota limit, the following steps might help resolve the is
137104

138105
#### From the Azure portal
139106

140-
1. On the Alerts screen, select **Manage alert rules**.
107+
1. On the Alerts screen in Azure Monitor, select **Alert rules**.
141108
1. In the **Subscription** dropdown control, filter to the subscription you want. (Make sure you don't filter to a specific resource group, resource type, or resource.)
142109
1. In the **Signal type** dropdown control, select **Log Search**.
143110
1. Verify that the **Status** dropdown control is set to **Enabled**.
@@ -147,7 +114,8 @@ The total number of log search alert rules is displayed above the rules list.
147114
#### From API
148115

149116
- PowerShell - [Get-AzScheduledQueryRule](/powershell/module/az.monitor/get-azscheduledqueryrule)
150-
- REST API - [List by subscription](/rest/api/monitor/scheduledqueryrule-2021-02-01-preview/scheduled-query-rules/list-by-subscription)
117+
- CLI: [az monitor scheduled-query list](/cli/azure/monitor/scheduled-query#az-monitor-scheduled-query-list)
118+
- REST API - [List by subscription](/rest/api/monitor/scheduledqueryrule-2021-08-01/scheduled-query-rules/list-by-subscription)
151119

152120
## Activity log example when rule is disabled
153121

0 commit comments

Comments
 (0)