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/diagnostic-settings.md
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.subservice: logs
11
11
12
12
# Create diagnostic setting to collect resource logs and metrics in Azure
13
13
14
-
[Platform logs](platform-logs-overview.md) in Azure, including the Azure Activity log and resource logs, provide detailed diagnostic and auditing information for Azure resources and the Azure platform they depend on. [Platform metrics](data-platform-metrics.md) are collected by default and typically stored in the Azure Monitor metrics database.
14
+
[Platform logs](platform-logs-overview.md) in Azure, including the Azure Activity log and resource logs, provide detailed diagnostic and auditing information for Azure resources and the Azure platform they depend on. [Platform metrics](data-platform-metrics.md) are collected by default and typically stored in the Azure Monitor metrics database.
15
15
16
16
This article provides details on creating and configuring diagnostic settings to send platform metrics and platform logs to different destinations.
17
17
@@ -22,14 +22,13 @@ Each Azure resource requires its own diagnostic setting, which defines the follo
22
22
23
23
- Categories of logs and metric data sent to the destinations defined in the setting. The available categories will vary for different resource types.
24
24
- One or more destinations to send the logs. Current destinations include Log Analytics workspace, Event Hubs, and Azure Storage.
25
-
26
-
A single diagnostic setting can define no more than one of each of the destinations. If you want to send data to more than one of a particular destination type (for example, two different Log Analytics workspaces), then create multiple settings. Each resource can have up to 5 diagnostic settings.
27
25
26
+
A single diagnostic setting can define no more than one of each of the destinations. If you want to send data to more than one of a particular destination type (for example, two different Log Analytics workspaces), then create multiple settings. Each resource can have up to 5 diagnostic settings.
28
27
29
28
> [!NOTE]
30
29
> [Platform metrics](metrics-supported.md) are collected automatically to [Azure Monitor Metrics](data-platform-metrics.md). Diagnostic settings can be used to collect metrics for certain Azure services into Azure Monitor Logs for analysis with other monitoring data using [log queries](../log-query/log-query-overview.md).
31
30
32
-
## Destinations
31
+
## Destinations
33
32
34
33
Platform logs and metrics can be sent to the destinations in the following table. Follow each link in the following table for details on sending data to that destination.
35
34
@@ -84,26 +83,25 @@ You can configure diagnostic settings in the Azure portal either from the Azure
84
83
85
84

86
85
87
-
1.**Log Analytics** - Enter the subscription and workspace. If you don't have a workspace, you need to [create one before proceeding](../learn/quick-create-workspace.md).
86
+
1.**Log Analytics** - Enter the subscription and workspace. If you don't have a workspace, you need to [create one before proceeding](../learn/quick-create-workspace.md).
88
87
89
88
1.**Event hubs** - Specify the following criteria:
90
89
- The subscription which the event hub is part of
91
90
- The Event hub namespace - If you do not yet have one, you'll need [to create one](../../event-hubs/event-hubs-create.md)
92
91
- An Event hub name (optional) to send all data to. If you don't specify a name, an event hub is created for each log category. If you are sending multiple categories, you may want to specify a name to limit the number of event hubs created. See [Azure Event Hubs quotas and limits](../../event-hubs/event-hubs-quotas.md) for details.
93
92
- An Event Hub policy (optional) A policy defines the permissions that the streaming mechanism has. For more information, see [Event-hubs-features](../../event-hubs/event-hubs-features.md#publisher-policy).
94
-
95
-
1.**Storage** - Choose the subscription, storage account, and retention policy.
96
-
93
+
94
+
1.**Storage** - Choose the subscription, storage account, and retention policy.
95
+
97
96

98
97
99
-
> [!WARNING]
100
-
> Considering setting the retention policy to 0 and manually deleting your data from storage to avoid possible confusion in the future. If you choose a retention policy that is greater than 0, the expiration date is attached to the logs at the time of storage. You can't change the date for those logs once stored, though you can always delete them manually. For example, if you set the retention policy for *AllMetrics* to 180 days and then 24 hours later set it to 365 days, the metrics stored during those first 24 hours will be automatically deleted after 180 days, while all subsequent metrics will be automatically deleted after 365 days.
98
+
> [!WARNING]
99
+
> Considering setting the retention policy to 0 and manually deleting your data from storage to avoid possible confusion in the future. If you choose a retention policy that is greater than 0, the expiration date is attached to the logs at the time of storage. You can't change the date for those logs once stored, though you can always delete them manually. For example, if you set the retention policy for *AllMetrics* to 180 days and then 24 hours later set it to 365 days, the metrics stored during those first 24 hours will be automatically deleted after 180 days, while all subsequent metrics will be automatically deleted after 365 days.
101
100
102
101
6. Click **Save**.
103
102
104
103
After a few moments, the new setting appears in your list of settings for this resource, and logs are streamed to the specified destinations as new event data is generated. It may take up to 15 minutes between when an event is emitted and when it [appears in a Log Analytics workspace](data-ingestion-time.md).
105
104
106
-
107
105
## Create diagnostic settings using PowerShell
108
106
109
107
Use the [Set-AzDiagnosticSetting](https://docs.microsoft.com/powershell/module/az.monitor/set-azdiagnosticsetting) cmdlet to create a diagnostic setting with [Azure PowerShell](powershell-quickstart-samples.md). See the documentation for this cmdlet for descriptions of its parameters.
@@ -117,7 +115,6 @@ Following is an example PowerShell cmdlet to create a diagnostic setting using a
Use the [az monitor diagnostic-settings create](https://docs.microsoft.com/cli/azure/monitor/diagnostic-settings?view=azure-cli-latest#az-monitor-diagnostic-settings-create) command to create a diagnostic setting with [Azure CLI](https://docs.microsoft.com/cli/azure/monitor?view=azure-cli-latest). See the documentation for this command for descriptions of its parameters.
@@ -127,8 +124,6 @@ Use the [az monitor diagnostic-settings create](https://docs.microsoft.com/cli/a
127
124
128
125
Following is an example CLI command to create a diagnostic setting using all three destinations.
129
126
130
-
131
-
132
127
```azurecli
133
128
az monitor diagnostic-settings create \
134
129
--name KeyVault-Diagnostics \
@@ -141,12 +136,13 @@ az monitor diagnostic-settings create \
141
136
```
142
137
143
138
### Configure diagnostic settings using REST API
144
-
See [Diagnostic Settings](https://docs.microsoft.com/rest/api/monitor/diagnosticsettings) to create or update diagnostic settings using the [Azure Monitor REST API](https://docs.microsoft.com/rest/api/monitor/).
145
139
140
+
See [Diagnostic Settings](https://docs.microsoft.com/rest/api/monitor/diagnosticsettings) to create or update diagnostic settings using the [Azure Monitor REST API](https://docs.microsoft.com/rest/api/monitor/).
146
141
147
142
### Configure diagnostic settings using Resource Manager template
143
+
148
144
See [Create diagnostic setting in Azure Monitor using a Resource Manager template](diagnostic-settings-template.md) to create or update diagnostic settings with a Resource Manager template.
149
145
150
146
## Next steps
151
147
152
-
*[Read more about Azure platform Logs](platform-logs-overview.md)
148
+
-[Read more about Azure platform Logs](platform-logs-overview.md)
0 commit comments