az monitor data-collection rule log-analytics

Note

This reference is part of the monitor-control-service extension for the Azure CLI (version 2.15.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

az monitor data-collection rule log-analytics add

Add Log Analytics destinations of a data collection rule.

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 list

List Log Analytics destinations of a data collection rule.

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 update

Update a Log Analytics destination of a data collection rule.

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 --name
                                                  --resource-id
                                                  [--ids]
                                                  [--resource-group]
                                                  [--rule-name]
                                                  [--subscription]

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-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/workspace2"

Required Parameters

--name -n

A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.

--resource-id

The resource ID of the Log Analytics workspace.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rule-name

The name of the data collection rule. The name is case insensitive.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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 --name
                                                     [--ids]
                                                     [--resource-group]
                                                     [--rule-name]
                                                     [--subscription]

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

--name -n

A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rule-name

The name of the data collection rule. The name is case insensitive.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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 --resource-group
                                                   --rule-name

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

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rule-name

The name of the data collection rule. The name is case insensitive.

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 --name
                                                   [--ids]
                                                   [--resource-group]
                                                   [--rule-name]
                                                   [--subscription]

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

--name -n

A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--rule-name

The name of the data collection rule. The name is case insensitive.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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 --name
                                                     [--ids]
                                                     [--resource-group]
                                                     [--resource-id]
                                                     [--rule-name]
                                                     [--subscription]

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

--name -n

A friendly name for the destination. This name should be unique across all destinations (regardless of type) within the data collection rule.

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--resource-id

The resource ID of the Log Analytics workspace.

--rule-name

The name of the data collection rule. The name is case insensitive.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.