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/essentials/activity-log.md
+28-29Lines changed: 28 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ ms.author: bwren
9
9
---
10
10
11
11
# Azure Activity log
12
-
The Activity log is a [platform log](./platform-logs-overview.md) in Azure that provides insight into subscription-level events. This includes such information as when a resource is modified or when a virtual machine is started. You can view the Activity log in the Azure portal or retrieve entries with PowerShell and CLI. This article provides details on viewing the Activity log and sending it to different destinations.
12
+
The Activity log is a [platform log](./platform-logs-overview.md) in Azure that provides insight into subscription-level events. Activity log includes such information as when a resource is modified or when a virtual machine is started. You can view the Activity sign in the Azure portal or retrieve entries with PowerShell and CLI. This article provides details on viewing the Activity log and sending it to different destinations.
13
13
14
-
For additional functionality, you should create a diagnostic setting to send the Activity log to one or more of these locations for the following reasons:
14
+
For more functionality, you should create a diagnostic setting to send the Activity log to one or more of these locations for the following reasons:
15
15
- to [Azure Monitor Logs](../logs/data-platform-logs.md) for more complex querying and alerting, and longer retention (up to 2 years)
16
16
- to Azure Event Hubs to forward outside of Azure
17
17
- to Azure Storage for cheaper, long-term archiving
@@ -23,10 +23,10 @@ See [Create diagnostic settings to send platform logs and metrics to different d
23
23
24
24
## Retention Period
25
25
26
-
Activity log events are retained in Azure for **90 days** and then deleted. There is no charge for entries during this time regardless of volume. For additional functionality such as longer retention, you should create a diagnostic setting and route the entires to another location based on your needs. See the criteria in the earlier section of this article.
26
+
Activity log events are retained in Azure for **90 days** and then deleted. There is no charge for entries during this time regardless of volume. For more functionality such as longer retention, you should create a diagnostic setting and route the entires to another location based on your needs. See the criteria in the earlier section of this article.
27
27
28
28
## View the Activity log
29
-
You can access the Activity log from most menus in the Azure portal. The menu that you open it from determines its initial filter. If you open it from the **Monitor** menu, then the only filter will be on the subscription. If you open it from a resource's menu, then the filter will be set to that resource. You can always change the filter though to view all other entries. Click**Add Filter** to add additional properties to the filter.
29
+
You can access the Activity log from most menus in the Azure portal. The menu that you open it from determines its initial filter. If you open it from the **Monitor** menu, then the only filter will be on the subscription. If you open it from a resource's menu, then the filter is set to that resource. You can always change the filter though to view all other entries. Select**Add Filter** to add more properties to the filter.
@@ -43,13 +43,13 @@ For some events, you can view the Change history, which shows what changes happe
43
43
44
44

45
45
46
-
If there are any associated changes with the event, you'll see a list of changes that you can select. This opens up the **Change history (Preview)** page. On this page, you see the changes to the resource. In the following example, you can see not only that the VM changed sizes, but what the previous VM size was before the change and what it was changed to. To learn more about change history, see [Get resource changes](../../governance/resource-graph/how-to/get-resource-changes.md).
46
+
If there are any associated changes with the event, you will see a list of changes that you can select. This opens up the **Change history (Preview)** page. On this page, you see the changes to the resource. In the following example, you can see not only that the VM changed sizes, but what the previous VM size was before the change and what it was changed to. To learn more about change history, see [Get resource changes](../../governance/resource-graph/how-to/get-resource-changes.md).
47
47
48
48

49
49
50
50
51
51
### Other methods to retrieve Activity log events
52
-
You can also access Activity log events using the following methods.
52
+
You can also access Activity log events using the following methods:
53
53
54
54
- Use the [Get-AzLog](/powershell/module/az.monitor/get-azlog) cmdlet to retrieve the Activity Log from PowerShell. See [Azure Monitor PowerShell samples](../powershell-samples.md#retrieve-activity-log).
55
55
- Use [az monitor activity-log](/cli/azure/monitor/activity-log) to retrieve the Activity Log from CLI. See [Azure Monitor CLI samples](../cli-samples.md#view-activity-log).
@@ -68,18 +68,18 @@ You can also access Activity log events using the following methods.
68
68
- No data retention charges for the first 90 days for Activity log data stored in a Log Analytics workspace.
69
69
70
70
71
-
[Create a diagnostic setting](./diagnostic-settings.md) to send the Activity log to a Log Analytics workspace. You can send the Activity log from any single subscription to up to five workspaces.
71
+
[Create a diagnostic setting](./diagnostic-settings.md) to send the Activity log to a Log Analytics workspace. You can send the Activity log from any single subscription to up to five workspaces.
72
72
73
73
Activity log data in a Log Analytics workspace is stored in a table called *AzureActivity* that you can retrieve with a [log query](../logs/log-query-overview.md) in [Log Analytics](../logs/log-analytics-tutorial.md). The structure of this table varies depending on the [category of the log entry](activity-log-schema.md). For a description of the table properties, see the [Azure Monitor data reference](/azure/azure-monitor/reference/tables/azureactivity).
74
74
75
-
For example, to view a count of Activity log records for each category, use the following query.
75
+
For example, to view a count of Activity log records for each category, use the following query:
76
76
77
77
```kusto
78
78
AzureActivity
79
79
| summarize count() by CategoryValue
80
80
```
81
81
82
-
To retrieve all records in the administrative category, use the following query.
82
+
To retrieve all records in the administrative category, use the following query:
83
83
84
84
```kusto
85
85
AzureActivity
@@ -149,7 +149,7 @@ Following is sample output data from Event Hubs for an Activity log:
149
149
```
150
150
151
151
## Send to Azure storage
152
-
Send the Activity Log to an Azure Storage Account if you want to retain your log data longer than 90 days for audit, static analysis, or backup. If you only need to retain your events for 90 days or less you do not need to set up archival to a Storage Account, since Activity Log events are retained in the Azure platform for 90 days.
152
+
Send the Activity Log to an Azure Storage Account if you want to retain your log data longer than 90 days for audit, static analysis, or backup. If you only must retain your events for 90 days or less you do not need to set up archival to a Storage Account, since Activity Log events are retained in the Azure platform for 90 days.
153
153
154
154
When you send the Activity log to Azure, a storage container is created in the Storage Account as soon as an event occurs. The blobs in the container use the following naming convention:
155
155
@@ -179,18 +179,18 @@ This section describes legacy methods for collecting the Activity log that were
179
179
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.
180
180
181
181
1. From the **Azure Monitor** menu in the Azure portal, select **Activity log**.
If a log profile already exists, you first need to remove the existing log profile and then create a new one.
193
+
If a log profile already exists, you first must remove the existing log profile and then create new one.
194
194
195
195
1. Use `Get-AzLogProfile` to identify if a log profile exists. If a log profile does exist, note the *name* property.
196
196
@@ -213,7 +213,7 @@ If a log profile already exists, you first need to remove the existing log profi
213
213
| StorageAccountId |No |Resource ID of the Storage Account where the Activity Log should be saved. |
214
214
| serviceBusRuleId |No |Service Bus Rule ID for the Service Bus namespace you would like to have Event Hubs created in. This is a string with the format: `{service bus resource ID}/authorizationrules/{key name}`. |
215
215
| Location |Yes |Comma-separated list of regions for which you would like to collect Activity Log events. |
216
-
| RetentionInDays |Yes |Number of days for which events should be retained in the Storage Account, between 1 and 365. A value of zero stores the logs indefinitely. |
216
+
| RetentionInDays |Yes |Number of days for which events should be retained in the Storage Account, from 1 through 365. A value of zero stores the logs indefinitely. |
217
217
| Category |No |Comma-separated list of event categories that should be collected. Possible values are _Write_, _Delete_, and _Action_. |
218
218
219
219
### Example script
@@ -240,11 +240,11 @@ Following is a sample PowerShell script to create a log profile that writes the
240
240
241
241
### Configure log profile using Azure CLI
242
242
243
-
If a log profile already exists, you first need to remove the existing log profile and then create a new log profile.
243
+
If a log profile already exists, you first must remove the existing log profile and then create a log profile.
244
244
245
245
1. Use `az monitor log-profiles list` to identify if a log profile exists.
246
246
2. Use `az monitor log-profiles delete --name "<log profile name>` to remove the log profile using the value from the *name* property.
247
-
3. Use `az monitor log-profiles create` to create a new log profile:
247
+
3. Use `az monitor log-profiles create` to create a log profile:
248
248
249
249
```azurecli-interactive
250
250
az monitor log-profiles create --name "default" --location null --locations "global" "eastus" "westus" --categories "Delete" "Write" "Action" --enabled false --days 0 --service-bus-rule-id "/subscriptions/<YOUR SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.EventHub/namespaces/<Event Hub NAME SPACE>/authorizationrules/RootManageSharedAccessKey"
@@ -254,31 +254,31 @@ If a log profile already exists, you first need to remove the existing log profi
254
254
| name |Yes |Name of your log profile. |
255
255
| storage-account-id |Yes |Resource ID of the Storage Account to which Activity Logs should be saved. |
256
256
| locations |Yes |Space-separated list of regions for which you would like to collect Activity Log events. You can view a list of all regions for your subscription using `az account list-locations --query [].name`. |
257
-
| days |Yes |Number of days for which events should be retained, between 1 and 365. A value of zero will store the logs indefinitely (forever). If zero, then the enabled parameter should be set to false. |
257
+
| days |Yes |Number of days for which events should be retained, from 1 through 365. A value of zero will store the logs indefinitely (forever). If zero, then the enabled parameter should be set to false. |
258
258
|enabled | Yes |True or False. Used to enable or disable the retention policy. If True, then the days parameter must be a value greater than 0.
259
259
| categories |Yes |Space-separated list of event categories that should be collected. Possible values are Write, Delete, and Action. |
260
260
261
261
262
262
### Log Analytics workspace
263
-
The legacy method for sending the Activity log into a Log Analytics workspace is connecting the log in the workspace configuration.
263
+
The legacy method for sending the Activity log into a Log Analytics workspace is connecting the sign in the workspace configuration.
264
264
265
265
1. From the **Log Analytics workspaces** menu in the Azure portal, select the workspace to collect the Activity Log.
266
266
1. In the **Workspace Data Sources** section of the workspace's menu, select **Azure Activity log**.
267
-
1.Click the subscription you want to connect.
267
+
1.Select the subscription that you want to connect.
268
268
269
269

270
270
271
-
2.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.
271
+
2.Select**Connect** to connect the Activity sign in the subscription to the selected workspace. If the subscription is already connected to another workspace, select**Disconnect** first to disconnect it.
To disable the setting, perform the same procedure and click**Disconnect** to remove the subscription from the workspace.
276
+
To disable the setting, perform the same procedure and select**Disconnect** to remove the subscription from the workspace.
277
277
278
278
### Data structure changes
279
-
Diagnostic settings send the same data as the legacy method used to send the Activity log with some changes to the structure of the *AzureActivity* table.
279
+
The Export activity logs experience, sends the same data as the legacy method used to send the Activity log with some changes to the structure of the *AzureActivity* table.
280
280
281
-
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 replacements 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.
281
+
The columns in the following table have been deprecated in the updated schema. They still exist in *AzureActivity* but they have no data. The replacements for these columns are not new, but they contain the same data as the deprecated column. They are in a different format, so you might need to modify log queries that use them.
282
282
283
283
|Activity Log JSON | Log Analytics column name<br/>*(older deprecated)*| New Log Analytics column name | Notes |
284
284
|:---------|:---------|:---------|:---------|
@@ -291,7 +291,7 @@ The columns in the following table have been deprecated in the updated schema. T
291
291
> [!Important]
292
292
> 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](/azure/kusto/query/datatypes-string-operators) to do a case insensitive comparison.
293
293
294
-
The following column have been added to *AzureActivity* in the updated schema:
294
+
The following columns have been added to *AzureActivity* in the updated schema:
295
295
296
296
- Authorization_d
297
297
- Claims_d
@@ -309,14 +309,14 @@ Monitoring solutions are accessed from the **Monitor** menu in the Azure portal.
Click the **Azure Activity Logs** tile to open the **Azure Activity Logs** view. The view includes the visualization parts in the following table. Each part lists up to 10 items matching that part's criteria for the specified time range. You can run a log query that returns all matching records by clicking **See all** at the bottom of the part.
312
+
Select the **Azure Activity Logs** tile to open the **Azure Activity Logs** view. The view includes the visualization parts in the table. Each part lists up to 10 items that matches that part's criteria for the specified time range. You can run a log query that returns all matching records by clicking **See all** at the bottom of the part.
>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.
319
+
>You will soon no longer be able to add the Activity Logs Analytics solution to your subscription with the Azure portal. You can add it using the following procedure with a Resource Manager template.
320
320
321
321
1. Copy the following json into a file called *ActivityLogTemplate*.json.
322
322
@@ -407,7 +407,6 @@ Click the **Azure Activity Logs** tile to open the **Azure Activity Logs** view.
407
407
408
408
409
409
## Next steps
410
-
411
410
* [Read an overview of platform logs](./platform-logs-overview.md)
0 commit comments