az monitor log-analytics workspace data-export

Manage data export ruls for log analytics workspace.

Commands

az monitor log-analytics workspace data-export create

Create a data export rule for a given workspace.

az monitor log-analytics workspace data-export delete

Delete a data export rule for a given workspace.

az monitor log-analytics workspace data-export list

List all data export ruleses for a given workspace.

az monitor log-analytics workspace data-export show

Show a data export rule for a given workspace.

az monitor log-analytics workspace data-export update

Update a data export rule for a given workspace.

az monitor log-analytics workspace data-export create

Create a data export rule for a given workspace.

For more information, see https://docs.microsoft.com/azure/azure-monitor/platform/logs-data-export.

az monitor log-analytics workspace data-export create --destination
                                                      --name
                                                      --resource-group
                                                      --tables
                                                      --workspace-name
                                                      [--enable {false, true}]

Examples

Create a data export rule for a given workspace.

az monitor log-analytics workspace data-export create -g MyRG --workspace-name MyWS -n MyDataExport --destination {sa_id_1} --enable -t {table_name}

Required Parameters

--destination

The destination resource ID. It should be a storage account, an event hub namespace or an event hub. If event hub namespace is provided, event hub would be created for each table automatically.

--name -n

Name of the data export rule.

--resource-group -g

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

--tables -t

An array of tables to export.

value from: `az monitor log-analytics workspace table list`
--workspace-name

Name of the Log Analytics Workspace.

Optional Parameters

--enable

Enable this data export rule.

accepted values: false, true

az monitor log-analytics workspace data-export delete

Delete a data export rule for a given workspace.

az monitor log-analytics workspace data-export delete --name
                                                      --resource-group
                                                      --workspace-name
                                                      [--yes]

Required Parameters

--name -n

Name of the data export rule.

--resource-group -g

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

--workspace-name

Name of the Log Analytics Workspace.

Optional Parameters

--yes -y

Do not prompt for confirmation.

az monitor log-analytics workspace data-export list

List all data export ruleses for a given workspace.

az monitor log-analytics workspace data-export list --resource-group
                                                    --workspace-name

Required Parameters

--resource-group -g

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

--workspace-name

Name of the Log Analytics Workspace.

az monitor log-analytics workspace data-export show

Show a data export rule for a given workspace.

az monitor log-analytics workspace data-export show --name
                                                    --resource-group
                                                    --workspace-name

Required Parameters

--name -n

Name of the data export rule.

--resource-group -g

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

--workspace-name

Name of the Log Analytics Workspace.

az monitor log-analytics workspace data-export update

Update a data export rule for a given workspace.

For more information, see https://docs.microsoft.com/azure/azure-monitor/platform/logs-data-export.

az monitor log-analytics workspace data-export update --name
                                                      --resource-group
                                                      --tables
                                                      --workspace-name
                                                      [--add]
                                                      [--destination]
                                                      [--enable {false, true}]
                                                      [--force-string]
                                                      [--remove]
                                                      [--set]

Examples

Update a data export rule for a given workspace.

az monitor log-analytics workspace data-export update -g MyRG --workspace-name MyWS -n MyDataExport --destination {namespace_id} -t {table_name} --enable false

Required Parameters

--name -n

Name of the data export rule.

--resource-group -g

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

--tables -t

An array of tables to export.

value from: `az monitor log-analytics workspace table list`
--workspace-name

Name of the Log Analytics Workspace.

Optional Parameters

--add

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>.

--destination

The destination resource ID. It should be a storage account, an event hub namespace or an event hub. If event hub namespace is provided, event hub would be created for each table automatically.

--enable

Enable this data export rule.

accepted values: false, true
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.