az monitor diagnostic-settings
Manage service diagnostic settings.
Commands
| az monitor diagnostic-settings categories |
Retrieve service diagnostic settings categories. |
| az monitor diagnostic-settings categories list |
List the diagnostic settings categories for the specified resource. |
| az monitor diagnostic-settings categories show |
Gets the diagnostic settings category for the specified resource. |
| az monitor diagnostic-settings create |
Create diagnostic settings for the specified resource. |
| az monitor diagnostic-settings delete |
Deletes existing diagnostic settings for the specified resource. |
| az monitor diagnostic-settings list |
Gets the active diagnostic settings list for the specified resource. |
| az monitor diagnostic-settings show |
Gets the active diagnostic settings for the specified resource. |
| az monitor diagnostic-settings subscription |
Manage diagnostic settings for subscription. |
| az monitor diagnostic-settings subscription create |
Create diagnostic settings for a subscription. |
| az monitor diagnostic-settings subscription delete |
Deletes existing subscription diagnostic settings for the specified resource. |
| az monitor diagnostic-settings subscription list |
Gets the active subscription diagnostic settings list for the specified subscriptionId. |
| az monitor diagnostic-settings subscription show |
Gets the active subscription diagnostic settings for the specified resource. |
| az monitor diagnostic-settings subscription update |
Update diagnostic settings for a subscription. |
| az monitor diagnostic-settings update |
Update diagnostic settings. |
az monitor diagnostic-settings create
Create diagnostic settings for the specified resource.
For more information, visit: https://docs.microsoft.com/rest/api/monitor/diagnosticsettings/createorupdate#metricsettings.
az monitor diagnostic-settings create --name
--resource
[--event-hub]
[--event-hub-rule]
[--export-to-resource-specific {false, true}]
[--logs]
[--metrics]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
[--storage-account]
[--workspace]
Examples
Create diagnostic settings, retention here only applies when the target is a storage account.
az monitor diagnostic-settings create --resource {ID} -n {name}
--storage-account {storageAccount}
--logs '[
{
"category": "WorkflowRuntime",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
}
]'
--metrics '[
{
"category": "WorkflowRuntime",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
}
]'
Required Parameters
The name of the diagnostic settings.
Name or ID of the target resource.
Optional Parameters
Name or ID an event hub. If none is specified, the default event hub will be selected.
Name or ID of the event hub authorization rule.
Indicate that the export to LA must be done to a resource specific table, a.k.a. dedicated or fixed schema table, as opposed to the default dynamic schema table called AzureDiagnostics. This argument is effective only when the argument --workspace is also given.
JSON encoded list of logs settings. Use '@{file}' to load from a file.For more information, visit: https://docs.microsoft.com/rest/api/monitor/diagnosticsettings/createorupdate#logsettings.
JSON encoded list of metric settings. Use '@{file}' to load from a file. For more information, visit: https://docs.microsoft.com/rest/api/monitor/diagnosticsettings/createorupdate#metricsettings.
Name of the resource group for the Log Analytics and Storage Account when the name of the service instead of a full resource ID is given.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Name or ID of the storage account to send diagnostic logs to.
Name or ID of the Log Analytics workspace to send diagnostic logs to.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings delete
Deletes existing diagnostic settings for the specified resource.
az monitor diagnostic-settings delete --name
--resource
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
Required Parameters
The name of the diagnostic setting.
Name or ID of the target resource.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings list
Gets the active diagnostic settings list for the specified resource.
az monitor diagnostic-settings list --resource
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
Required Parameters
Name or ID of the target resource.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings show
Gets the active diagnostic settings for the specified resource.
az monitor diagnostic-settings show --name
--resource
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
Required Parameters
The name of the diagnostic setting.
Name or ID of the target resource.
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings update
Update diagnostic settings.
az monitor diagnostic-settings update --name
--resource
[--add]
[--force-string]
[--remove]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
[--set]
Examples
Update diagnostic settings. (autogenerated)
az monitor diagnostic-settings update --name MyDiagnosticSetting --resource myScaleSet --set retentionPolicy.days=365
Required Parameters
The name of the diagnostic setting.
Name or ID of the target resource.
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
الملاحظات
إرسال الملاحظات وعرضها المتعلقة بـ