az monitor diagnostic-settings subscription
Manage diagnostic settings for subscription.
Commands
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 subscription create
Create diagnostic settings for a subscription.
az monitor diagnostic-settings subscription create --location
--logs
--name
[--event-hub-auth-rule]
[--event-hub-name]
[--service-bus-rule]
[--storage-account]
[--subscription]
[--workspace]
Examples
Create diagnostic settings for a subscription with EventHub.
az monitor diagnostic-settings subscription create -n {name} --location westus --event-hub-auth-rule {eventHubRuleID} --storage-account {storageAccount} \
--logs '[
{
"category": "Security",
"enabled": true,
},
{
"category": "Administrative",
"enabled": true,
},
{
"category": "ServiceHealth",
"enabled": true,
},
{
"category": "Alert",
"enabled": true,
},
{
"category": "Recommendation",
"enabled": true,
},
{
"category": "Policy",
"enabled": true,
},
{
"category": "Autoscale",
"enabled": true,
},
{
"category": "ResourceHealth",
"enabled": true,
}
]'
Required Parameters
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
JSON encoded list of logs settings. Use '@{file}' to load from a file.
The name of the diagnostic setting.
Optional Parameters
The resource Id for the event hub authorization rule.
The name of the event hub. If none is specified, the default event hub will be selected.
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format '{service bus resource ID}/authorizationrules/{key name}'.
The resource id of the storage account to which you would like to send the Activity Log.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The resource id of the log analytics workspace.
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.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings subscription delete
Deletes existing subscription diagnostic settings for the specified resource.
az monitor diagnostic-settings subscription delete --name
[--subscription]
[--yes]
Required Parameters
The name of the diagnostic setting.
Optional Parameters
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
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.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings subscription list
Gets the active subscription diagnostic settings list for the specified subscriptionId.
az monitor diagnostic-settings subscription list [--query-examples]
[--subscription]
Optional Parameters
Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings subscription show
Gets the active subscription diagnostic settings for the specified resource.
az monitor diagnostic-settings subscription show --name
[--query-examples]
[--subscription]
Required Parameters
The name of the diagnostic setting.
Optional Parameters
Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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.
Increase logging verbosity. Use --debug for full debug logs.
az monitor diagnostic-settings subscription update
Update diagnostic settings for a subscription.
az monitor diagnostic-settings subscription update --name
[--add]
[--event-hub-auth-rule]
[--event-hub-name]
[--force-string]
[--logs]
[--remove]
[--service-bus-rule]
[--set]
[--storage-account]
[--subscription]
[--workspace]
Required Parameters
The name of the diagnostic setting.
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>.
The resource Id for the event hub authorization rule.
The name of the event hub. If none is specified, the default event hub will be selected.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
JSON encoded list of logs settings. Use '@{file}' to load from a file.
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format '{service bus resource ID}/authorizationrules/{key name}'.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
The resource id of the storage account to which you would like to send the Activity Log.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The resource id of the log analytics workspace.
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.
Increase logging verbosity. Use --debug for full debug logs.