az monitor data-collection rule log-analytics
Note
This reference is part of the monitor-control-service extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az monitor data-collection rule log-analytics command. Learn more about extensions.
Manage Log Analytics destinations.
Commands
Name | Description | Type | Status |
---|---|---|---|
az monitor data-collection rule log-analytics add |
Add Log Analytics destinations of a data collection rule. |
Extension | GA |
az monitor data-collection rule log-analytics delete |
Delete a Log Analytics destinations of a data collection rule. |
Extension | GA |
az monitor data-collection rule log-analytics list |
List Log Analytics destinations of a data collection rule. |
Extension | GA |
az monitor data-collection rule log-analytics show |
Show a Log Analytics destination of a data collection rule. |
Extension | GA |
az monitor data-collection rule log-analytics update |
Update a Log Analytics destination of a data collection rule. |
Extension | GA |
az monitor data-collection rule log-analytics add
Add Log Analytics destinations of a data collection rule.
az monitor data-collection rule log-analytics add --data-collection-rule-name
--name
--resource-group
[--resource-id]
Examples
Add Log Analytics destinations of a data collection rule
az monitor data-collection rule log-analytics add --rule-name myCollectionRule --resource-group myResourceGroup --name workspace2 --resource-id /subscriptions/703362b3-f2784e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/workspace2
Required Parameters
The name of the data collection rule. The name is case insensitive.
A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The resource ID of the Log Analytics workspace.
Global Parameters
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 data-collection rule log-analytics delete
Delete a Log Analytics destinations of a data collection rule.
az monitor data-collection rule log-analytics delete --data-collection-rule-name
--name
--resource-group
Examples
Delete a Log Analytics destinations of a data collection rule
az monitor data-collection rule log-analytics delete --rule-name myCollectionRule --resource-group myResourceGroup --name workspace2
Required Parameters
The name of the data collection rule. The name is case insensitive.
A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
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 data-collection rule log-analytics list
List Log Analytics destinations of a data collection rule.
az monitor data-collection rule log-analytics list --data-collection-rule-name
--resource-group
Examples
List Log Analytics destinations of a data collection rule
az monitor data-collection rule log-analytics list --rule-name myCollectionRule --resource-group myResourceGroup
Required Parameters
The name of the data collection rule. The name is case insensitive.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
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 data-collection rule log-analytics show
Show a Log Analytics destination of a data collection rule.
az monitor data-collection rule log-analytics show --data-collection-rule-name
--name
--resource-group
Examples
Show a Log Analytics destination of a data collection rule
az monitor data-collection rule log-analytics show --rule-name myCollectionRule --resource-group myResourceGroup --name centralWorkspace
Required Parameters
The name of the data collection rule. The name is case insensitive.
A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
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 data-collection rule log-analytics update
Update a Log Analytics destination of a data collection rule.
az monitor data-collection rule log-analytics update --data-collection-rule-name
--name
--resource-group
[--add]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--remove]
[--resource-id]
[--set]
Examples
Update a Log Analytics destination of a data collection rule
az monitor data-collection rule log-analytics update --rule-name myCollectionRule --resource-group myResourceGroup --name workspace2 --resource-id "/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/anotherWorkspace"
Required Parameters
The name of the data collection rule. The name is case insensitive.
A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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 <indexToRemove>
OR --remove propertyToRemove
.
The resource ID of the Log Analytics workspace.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Global Parameters
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.