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/platform/activity-log-collect.md
+59-43Lines changed: 59 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,46 +10,40 @@ ms.date: 03/20/2020
10
10
---
11
11
12
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 can send the entries to other destinations to provide different methods of analysis. The methods to configure different destinations for the Activity log are in the process of changing. This article describes this transition and the roadmap for the collection and analysis for the Activity log.
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.
14
14
15
-
## Summary of changes
15
+
Collecting the Activity Log in a Log Analytics workspace provides the following advantages:
16
16
17
-
### Collection of Activity log
18
-
Like other platform logs, the Activity log can be sent to a Log Analytics workspace, Azure storage, or Azure Event Hubs. This configuration is now performed for the Activity log with a [diagnostic setting](diagnostic-setting.md), which is the same method used by resource logs. Prior to this change, there were two ways to sent the Activity log to these destinations:
17
+
- No charge for space 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](../log-query/log-query-overview.md) to perform complex analysis and gain deep insights on Activity Log entries.
20
+
- Store Activity log entries for longer than 90 days.
21
+
- Consolidate log entries from multiple Azure subscriptions into one location for analysis together.
19
22
20
-
- Send to a Log Analytics workspace by connect the Activity log to the workspace in the workspace configuration.
21
-
- Send to Azure storage or event hubs by creating a log profile.
22
23
23
-
### Analysis of Activity log
24
-
You can still [view the Activity log in the Azure portal](activity-log-view.md) without any configuration. What is changing is analysis of Activity log entries in a Log Analytics workspace. Activity log events are still sent to the *AzureActivity* table, and the same log queries can be used to analyze them. The Activity Logs Analytics monitoring solution is being deprecated along with the deprecation of Azure Monitor views. A new Azure Monitor workbook will be provided in the near future providing queries and visualizations for gaining insights into the Activity log.
25
24
25
+
## Collecting Activity log
26
+
The Activity log is collected automatically for [viewing in the Azure portal](activity-log-view.md). To send it to other destinations, create a [diagnostic setting](diagnostic-settings.md), which is the same method used by resource logs.
26
27
28
+
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 in the setting. If you have any legacy settings, make sure you disable them before creating a diagnostic setting. Having both enabled may result in duplicate data.
27
29
28
-
## Collecting Activity log
29
-
The method to send Activity log entries to an event hub or storage account or to a Log Analytics workspace has changed to use [diagnostic settings](diagnostic-settings.md) which has the following advantages over the previous methods:
30
+
31
+
> [!NOTE]
32
+
> Currently, you can only create a subscription level diagnostic setting using the Azure portal. To use other methods such as PowerShell or CLI, you can create a Resource Manager template.
33
+
34
+
35
+
## Legacy settings
36
+
While diagnostic settings are the preferred method to send the Activity log to different destinations, legacy methods are still available and will continue to work if you don't choose to replace with a diagnostic setting. Diagnostic settings have the following advantages over the previous methods, and it's recommended that you change any legacy configuration to this new strategy:
30
37
31
38
- Consistent method for collecting all platform logs.
32
39
- Collect Activity log across multiple subscriptions and tenants.
33
40
- Filter collection to only collect logs for particular categories.
34
41
- Collect all Activity log categories. Some categories are not collected using legacy method.
35
42
- Faster latency for log ingestion. The previous method has about 15 minutes latency while diagnostic settings adds only about 1 minute.
36
43
37
-
Connecting the Activity Log to a Log Analytics workspace provides the following benefits:
38
-
39
-
- Consolidate the Activity Log from multiple Azure subscriptions into one location for analysis.
40
-
- Store Activity Log entries for longer than 90 days.
41
-
- Correlate Activity Log data with other monitoring data collected by Azure Monitor.
42
-
- Use [log queries](../log-query/log-query-overview.md) to perform complex analysis and gain deep insights on Activity Log entries.
43
-
44
-
### Considerations
45
-
Consider the following details of Activity log collection using diagnostic settings before enabling this feature.
46
-
47
-
- The retention setting for collecting the Activity log to Azure storage has been removed meaning that data will be stored indefinitely until you remove it.
48
-
- Currently, you can only create a subscription level diagnostic setting using the Azure portal. To use other methods such as PowerShell or CLI, you can create a Resource Manager template.
49
44
50
-
51
-
### Work with legacy settings
52
-
Legacy settings for collecting the Activity log will continue to work if you don't choose to replace with a diagnostic setting. Use the following method to manage the log profile for a subscription.
45
+
### Log profiles
46
+
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.
53
47
54
48
1. From the **Azure Monitor** menu in the Azure portal, select **Activity log**.
55
49
3. Click **Diagnostic settings**.
@@ -60,10 +54,19 @@ Legacy settings for collecting the Activity log will continue to work if you don
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.
If you have existing settings to collect the Activity log, you should disable them before enabling it using diagnostic settings. Having both enabled may result in duplicate data.
67
70
68
71
### Disable collection into Log Analytics workspace
69
72
@@ -72,29 +75,31 @@ If you have existing settings to collect the Activity log, you should disable th
72
75
3. Click the subscription you want to disconnect.
73
76
4. Click **Disconnect** and then **Yes** when asked to confirm your choice.
74
77
75
-
### Disable log profile
76
78
77
-
1. Use the procedure described in [Work with legacy settings](#work-with-legacy-settings) to open legacy settings.
78
-
2. Disable any current collection to storage or event hubs.
79
+
### Analysis of Activity log
80
+
You can [view the Activity log in the Azure portal](activity-log-view.md) without any configuration. When you configure it to be collected into a Log Analytics workspace,
81
+
82
+
What is changing is analysis of Activity log entries in a Log Analytics workspace. Activity log events are still sent to the *AzureActivity* table, and the same log queries can be used to analyze them. The Activity Logs Analytics monitoring solution is being deprecated along with the deprecation of Azure Monitor views. A new Azure Monitor workbook will be provided in the near future providing queries and visualizations for gaining insights into the Activity log.
83
+
79
84
80
85
81
86
## Analyze Activity log in Log Analytics workspace
82
87
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.
83
88
84
89
85
90
### Differences in data
86
-
Diagnostic settings collect the same data as the previous methods used to collect the Activity log with the following current differences:
91
+
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.
87
92
88
-
The following columns have been removed. The replacement for these columns are in a different format, so you may need to modify log queries that use them. You may still see removed columns in the schema, but they won't be populated with data.
93
+
The columns in the following table have been deprecated. 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.
89
94
90
-
|Removed column | Replacement column |
95
+
|Deprecated column | Replacement column |
91
96
|:---|:---|
92
97
| ActivityStatus | ActivityStatusValue |
93
98
| ActivitySubstatus | ActivitySubstatusValue |
94
99
| OperationName | OperationNameValue |
95
100
| ResourceProvider | ResourceProviderValue |
96
101
97
-
The following column have been added:
102
+
The following column have been added to *AzureActivity*:
98
103
99
104
- Authorization_d
100
105
- Claims_d
@@ -103,9 +108,15 @@ The following column have been added:
103
108
> [!IMPORTANT]
104
109
> 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.
105
110
111
+
### Query sample
112
+
113
+
106
114
107
115
## Activity Logs Analytics monitoring solution
108
-
The Azure Log Analytics monitoring solution is currently being deprecated but can still be used if you already have it enabled. The option to enable the solution for a new subscription has been removed from the Azure portal, but you can enable it using the template and procedure in [Enable solution for new subscription](#enable-solution-for-new-subscription).
116
+
The Azure Log Analytics monitoring solution is currently being deprecated but can still be used if you already have it enabled. It cannot be used if you collect the Activity log using a diagnostic setting as described above. The option to enable the solution for a new subscription has been removed from the Azure portal, but you can enable it using the template and procedure in [Enable solution for new subscription](#enable-solution-for-new-subscription).
117
+
118
+
> [!IMPORTANT]
119
+
> The Activity Logs Analytics monitoring solution is not supported if you're collecting the Activity log using a diagnostic setting. You must continue to connect your subscription to a workspace to use the solution.
109
120
110
121
111
122
### Use the solution
@@ -118,15 +129,9 @@ 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. |
124
-
| 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. |
125
-
| 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. |
126
-
| 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. |
127
132
128
-
## Enable solution for new subscription
129
-
To enable the solution to collect and analyze the Activity log for a new subscription, follow the procedure below.
133
+
###Enable the solution for new subscriptions
134
+
You can no longer add a new subscription to the Activity Logs Analytics solution using the Azure portal, but you can add a new subscription using a resource manager template.
130
135
131
136
1. Copy the following json into a file called *ActivityLogTemplate*.json.
132
137
@@ -220,3 +225,14 @@ To enable the solution to collect and analyze the Activity log for a new subscri
220
225
- Learn more about the [Activity Log](platform-logs-overview.md).
221
226
- Learn more about the [Azure Monitor data platform](data-platform.md).
222
227
- Use [log queries](../log-query/log-query-overview.md) to view detailed information from your Activity Log.
228
+
229
+
230
+
231
+
232
+
### Considerations
233
+
Consider the following details of Activity log collection using diagnostic settings before enabling this feature.
234
+
235
+
- The retention setting for collecting the Activity log to Azure storage has been removed meaning that data will be stored indefinitely until you remove it.
0 commit comments