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
title: Collect Azure activity log in Log Analytics workspace
2
+
title: Collect and analyze Azure activity log in Azure Monitor
3
3
description: Collect the Azure Activity Log in Azure Monitor Logs and use the monitoring solution to analyze and search the Azure activity log across all your Azure subscriptions.
4
4
ms.subservice: logs
5
5
ms.topic: conceptual
6
6
author: bwren
7
7
ms.author: bwren
8
-
ms.date: 09/30/2019
8
+
ms.date: 03/24/2020
9
9
10
10
---
11
11
12
-
# Collect and analyze Azure activity logs in Log Analytics workspace in Azure Monitor
12
+
# Collect and analyze Azure Activity log in Azure Monitor
13
+
The [Azure Activity log](platform-logs-overview.md) is a [platform log](platform-logs-overview.md) that provides insight into subscription-level events that have occurred in Azure. While you can view the Activity log in the Azure portal, you should configure it to send to a Log Analytics workspace to enable additional features of Azure Monitor. This article describes how to perform this configuration and how to send the Activity log to Azure storage and event hubs.
13
14
14
-
> [!WARNING]
15
-
> You can now collect the Activity log into a Log Analytics workspace using a diagnostic setting similar to how you collect resource logs. See [Collect and analyze Azure activity logs in Log Analytics workspace in Azure Monitor](diagnostic-settings-legacy.md).
15
+
Collecting the Activity Log in a Log Analytics workspace provides the following advantages:
16
16
17
-
The [Azure Activity Log](platform-logs-overview.md) provides insight into subscription-level events that have occurred in your Azure subscription. This article describes how to collect the Activity Log into a Log Analytics workspace and how to use the Activity Log Analytics [monitoring solution](../insights/solutions.md), which provides log queries and views for analyzing this data.
17
+
- No data ingestion or data retention charge for Activity log data stored in a Log Analytics workspace.
18
+
- Correlate Activity log data with other monitoring data collected by Azure Monitor.
19
+
- Use log queries to perform complex analysis and gain deep insights on Activity Log entries.
20
+
- Use log alerts with Activity entries allowing for more complex alerting logic.
21
+
- Store Activity log entries for longer than 90 days.
22
+
- Consolidate log entries from multiple Azure subscriptions and tenants into one location for analysis together.
18
23
19
-
Connecting the Activity Log to a Log Analytics workspace provides the following benefits:
20
24
21
-
- Consolidate the Activity Log from multiple Azure subscriptions into one location for analysis.
22
-
- Store Activity Log entries for longer than 90 days.
23
-
- Correlate Activity Log data with other monitoring data collected by Azure Monitor.
24
-
- Use [log queries](../log-query/log-query-overview.md) to perform complex analysis and gain deep insights on Activity Log entries.
25
25
26
-
## Connect to Log Analytics workspace
27
-
A single workspace can be connected to the Activity Log for multiple subscriptions in the same Azure tenant. For collection across multiple tenants, see [Collect Azure Activity Logs into a Log Analytics workspace across subscriptions in different Azure Active Directory tenants](activity-log-collect-tenants.md).
26
+
## Collecting Activity log
27
+
The Activity log is collected automatically for [viewing in the Azure portal](activity-log-view.md). To collect it in a Log Analytics workspace or to send it Azure storage or event hubs, create a [diagnostic setting](diagnostic-settings.md). This is the same method used by resource logs making it consistent for all [platform logs](platform-logs-overview.md).
28
+
29
+
To create a diagnostic setting for the Activity log, select **Diagnostic settings** from the **Activity log** menu in Azure Monitor. See [Create diagnostic setting to collect platform logs and metrics in Azure](diagnostic-settings.md) for details on creating the setting. See [Categories in the Activity log](activity-log-view.md#categories-in-the-activity-log) for a description of the categories you can filter. If you have any legacy settings, make sure you disable them before creating a diagnostic setting. Having both enabled may result in duplicate data.
> Currently, you can only create a subscription level diagnostic setting using the Azure portal and a Resource Manager template.
36
+
37
+
38
+
## Legacy settings
39
+
While diagnostic settings are the preferred method to send the Activity log to different destinations, legacy methods will continue to work if you don't choose to replace with a diagnostic setting. Diagnostic settings have the following advantages over legacy methods, and it's recommended that you update your configuration:
40
+
41
+
- Consistent method for collecting all platform logs.
42
+
- Collect Activity log across multiple subscriptions and tenants.
43
+
- Filter collection to only collect logs for particular categories.
44
+
- Collect all Activity log categories. Some categories are not collected using legacy method.
45
+
- Faster latency for log ingestion. The previous method has about 15 minutes latency while diagnostic settings adds only about 1 minute.
28
46
29
-
> [!IMPORTANT]
30
-
> You may receive an error with the following procedure if the Microsoft.OperationalInsights and Microsoft.OperationsManagement resource providers aren't registered for your subscription. See [Azure resource providers and types](../../azure-resource-manager/management/resource-providers-and-types.md) to register these providers.
31
47
32
-
Use the following procedure to connect the Activity Log to your Log Analytics workspace:
48
+
49
+
### Log profiles
50
+
Log profiles are the legacy method for sending the Activity log to Azure storage or event hubs. Use the following procedure to continue working with a log profile or to disable it in preparation for migrating to a diagnostic setting.
51
+
52
+
1. From the **Azure Monitor** menu in the Azure portal, select **Activity log**.
1. Click **Connect** to connect the Activity log in the subscription to the selected workspace. If the subscription is already connected to another workspace, click **Disconnect** first to disconnect it.
To disable the setting, perform the same procedure and click **Disconnect** to remove the subscription from the workspace.
76
+
77
+
78
+
## Analyze Activity log in Log Analytics workspace
79
+
When you connect an Activity Log to a Log Analytics workspace, entries will be written to the workspace into a table called *AzureActivity* that you can retrieve with a [log query](../log-query/log-query-overview.md). The structure of this table varies depending on the [category of the log entry](activity-log-view.md#categories-in-the-activity-log). See [Azure Activity Log event schema](activity-log-schema.md) for a description of each category.
80
+
81
+
82
+
### Data structure changes
83
+
Diagnostic settings collect the same data as the legacy method used to collect the Activity log with some changes to the structure of the *AzureActivity* table.
84
+
85
+
The columns in the following table have been deprecated in the updated schema. They still exist in *AzureActivity* but they will have no data. The replacement for these columns are not new, but they contain the same data as the deprecated column. They are in a different format, so you may need to modify log queries that use them.
86
+
87
+
| Deprecated column | Replacement column |
88
+
|:---|:---|
89
+
| ActivityStatus | ActivityStatusValue |
90
+
| ActivitySubstatus | ActivitySubstatusValue |
91
+
| OperationName | OperationNameValue |
92
+
| ResourceProvider | ResourceProviderValue |
93
+
94
+
> [!IMPORTANT]
95
+
> In some cases, the values in these columns may be in all uppercase. If you have a query that includes these columns, you should use the [=~ operator](https://docs.microsoft.com/azure/kusto/query/datatypes-string-operators) to do a case insensitive comparison.
96
+
97
+
The following column have been added to *AzureActivity* in the updated schema:
98
+
99
+
- Authorization_d
100
+
- Claims_d
101
+
- Properties_d
43
102
44
-
## Analyze in Log Analytics workspace
45
-
When you connect an Activity Log to a Log Analytics workspace, entries will be written to the workspace into a table called **AzureActivity** that you can retrieve with a [log query](../log-query/log-query-overview.md). The structure of this table varies depending on the [category of log entry](activity-log-view.md#categories-in-the-activity-log). See [Azure Activity Log event schema](activity-log-schema.md) for a description of each category.
46
103
47
104
## Activity Logs Analytics monitoring solution
48
-
The Azure Log Analytics monitoring solution includes multiple log queries and views for analyzing the Activity Log records in your Log Analytics workspace.
105
+
The Azure Log Analytics monitoring solution will be deprecated soon and replaced by a workbook using the updated schema in the Log Analytics workspace. You can still use the solution if you already have it enabled, but it can only be used if you're collecting the Activity log using legacy settings.
106
+
49
107
50
-
### Install the solution
51
-
Use the procedure in [Install a monitoring solution](../insights/solutions.md#install-a-monitoring-solution) to install the **Activity Log Analytics** solution. There is no additional configuration required.
52
108
53
109
### Use the solution
54
110
Monitoring solutions are accessed from the **Monitor** menu in the Azure portal. Select **More** in the **Insights** section to open the **Overview** page with the solution tiles. The **Azure Activity Logs** tile displays a count of the number of **AzureActivity** records in your workspace.
@@ -60,12 +116,96 @@ Click the **Azure Activity Logs** tile to open the **Azure Activity Logs** view.
| Azure Activity Log Entries | Shows a bar chart of the top Azure Activity Log entry record totals for the date range that you have selected and shows a list of the top 10 activity callers. Click the bar chart to run a log search for `AzureActivity`. Click a caller item to run a log search returning all Activity Log entries for that item. |
66
-
| Activity Logs by Status | Shows a doughnut chart for Azure Activity Log status for the selected date range and a list of the top ten status records. Click the chart to run a log query for `AzureActivity | summarize AggregatedValue = count() by ActivityStatus`. Click a status item to run a log search returning all Activity Log entries for that status record. |
67
-
| Activity Logs by Resource | Shows the total number of resources with Activity Logs and lists the top ten resources with record counts for each resource. Click the total area to run a log search for `AzureActivity | summarize AggregatedValue = count() by Resource`, which shows all Azure resources available to the solution. Click a resource to run a log query returning all activity records for that resource. |
68
-
| Activity Logs by Resource Provider | Shows the total number of resource providers that produce Activity Logs and lists the top ten. Click the total area to run a log query for `AzureActivity | summarize AggregatedValue = count() by ResourceProvider`, which shows all Azure resource providers. Click a resource provider to run a log query returning all activity records for the provider. |
119
+
120
+
### Enable the solution for new subscriptions
121
+
You will soon no longer be able to add the Activity Logs Analytics solution to your subscription using the Azure portal. You can add it using the following procedure with a resource manager template.
122
+
123
+
1. Copy the following json into a file called *ActivityLogTemplate*.json.
Copy file name to clipboardExpand all lines: articles/azure-monitor/platform/activity-log-export.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.subservice: logs
13
13
# Export Azure Activity log to storage or Azure Event Hubs
14
14
15
15
> [!IMPORTANT]
16
-
> The method for sending the Azure Activity log to Azure Storage and Azure Event Hubs has changed to [diagnostic settings](diagnostic-settings.md). This article describes the legacy method which is in the process of being deprecated. See Update to [Azure Activity log collection and export](diagnostic-settings-legacy.md) for a comparison.
16
+
> The method for sending the Azure Activity log to Azure Storage and Azure Event Hubs has changed to [diagnostic settings](diagnostic-settings.md). This article describes the legacy method which is in the process of being deprecated. See Update to [Collect and analyze Azure Activity log in Azure Monitor](activity-log-collect.md) for a comparison.
17
17
18
18
19
19
The [Azure Activity Log](platform-logs-overview.md) provides insight into subscription-level events that have occurred in your Azure subscription. In addition to viewing the Activity log in the Azure portal or copying it to a Log Analytics workspace where it can be analyzed with other data collected by Azure Monitor, you can create a log profile to archive the Activity log to an Azure storage account or stream it to an Event Hub.
0 commit comments