az monitor log-analytics workspace

Manage Azure log analytics workspace.

Commands

az monitor log-analytics workspace create

Create a workspace instance.

az monitor log-analytics workspace data-export

Manage data export ruls for log analytics workspace.

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 delete

Delete a workspace instance.

az monitor log-analytics workspace get-schema

Get the schema for a given workspace.

az monitor log-analytics workspace get-shared-keys

Get the shared keys for a workspace.

az monitor log-analytics workspace linked-service

Manage linked service for log analytics workspace.

az monitor log-analytics workspace linked-service create

Create a linked service.

az monitor log-analytics workspace linked-service delete

Delete a linked service.

az monitor log-analytics workspace linked-service list

Gets all the linked services in a workspace.

az monitor log-analytics workspace linked-service show

Show the properties of a linked service.

az monitor log-analytics workspace linked-service update

Update a linked service.

az monitor log-analytics workspace linked-service wait

Place the CLI in a waiting state until a condition of the linked service is met.

az monitor log-analytics workspace linked-storage

Manage linked storage account for log analytics workspace.

az monitor log-analytics workspace linked-storage add

Add some linked storage accounts with specific data source type for log analytics workspace.

az monitor log-analytics workspace linked-storage create

Create some linked storage accounts for log analytics workspace.

az monitor log-analytics workspace linked-storage delete

Delete all linked storage accounts with specific data source type for log analytics workspace.

az monitor log-analytics workspace linked-storage list

List all linked storage accounts for a log analytics workspace.

az monitor log-analytics workspace linked-storage remove

Remove some linked storage accounts with specific data source type for log analytics workspace.

az monitor log-analytics workspace linked-storage show

List all linked storage accounts with specific data source type for a log analytics workspace.

az monitor log-analytics workspace list

Get a list of workspaces under a resource group or a subscription.

az monitor log-analytics workspace list-deleted-workspaces

Get a list of deleted workspaces that can be recovered in a subscription or a resource group.

az monitor log-analytics workspace list-management-groups

Get a list of management groups connected to a workspace.

az monitor log-analytics workspace list-usages

Get a list of usage metrics for a workspace.

az monitor log-analytics workspace pack

Manage intelligent packs for log analytics workspace.

az monitor log-analytics workspace pack disable

Disable an intelligence pack for a given workspace.

az monitor log-analytics workspace pack enable

Enable an intelligence pack for a given workspace.

az monitor log-analytics workspace pack list

List all the intelligence packs possible and whether they are enabled or disabled for a given workspace.

az monitor log-analytics workspace recover

Recover a workspace in a soft-delete state within 14 days.

az monitor log-analytics workspace saved-search

Manage saved search for log analytics workspace.

az monitor log-analytics workspace saved-search create

Create a saved search for a given workspace.

az monitor log-analytics workspace saved-search delete

Delete a saved search for a given workspace.

az monitor log-analytics workspace saved-search list

List all saved searches for a given workspace.

az monitor log-analytics workspace saved-search show

Show a saved search for a given workspace.

az monitor log-analytics workspace saved-search update

Update a saved search for a given workspace.

az monitor log-analytics workspace show

Show a workspace instance.

az monitor log-analytics workspace table

Manage tables for log analytics workspace.

az monitor log-analytics workspace table list

List all the tables for the given Log Analytics workspace.

az monitor log-analytics workspace table show

Get a Log Analytics workspace table.

az monitor log-analytics workspace table update

Update the properties of a Log Analytics workspace table, currently only support updating retention time.

az monitor log-analytics workspace update

Update a workspace instance.

az monitor log-analytics workspace create

Create a workspace instance.

az monitor log-analytics workspace create --resource-group
                                          --workspace-name
                                          [--capacity-reservation-level]
                                          [--ingestion-access {Disabled, Enabled}]
                                          [--location]
                                          [--no-wait]
                                          [--query-access {Disabled, Enabled}]
                                          [--quota]
                                          [--retention-time]
                                          [--sku]
                                          [--subscription]
                                          [--tags]

Examples

Create a workspace instance

az monitor log-analytics workspace create -g MyResourceGroup -n MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--capacity-reservation-level --level

The capacity reservation level for this workspace, when CapacityReservation sku is selected. The maximum value is 1000 and must be in multiples of 100. If you want to increase the limit, please contact LAIngestionRate@microsoft.com.

--ingestion-access

The public network access type to access workspace ingestion.

accepted values: Disabled, Enabled
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

--query-access

The public network access type to access workspace query.

accepted values: Disabled, Enabled
--quota

The workspace daily quota for ingestion in gigabytes. The minimum value is 0.023 and default is -1 which means unlimited.

--retention-time

The workspace data retention in days.

default value: 30
--sku

The supported value: PerGB2018, CapacityReservation.

default value: PerGB2018
--subscription

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

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

az monitor log-analytics workspace delete

Delete a workspace instance.

az monitor log-analytics workspace delete --resource-group
                                          --workspace-name
                                          [--force {false, true}]
                                          [--subscription]
                                          [--yes]

Examples

Delete a workspace instance. (autogenerated)

az monitor log-analytics workspace delete --resource-group MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--force -f

Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered.

accepted values: false, true
--subscription

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

--yes -y

Do not prompt for confirmation.

az monitor log-analytics workspace get-schema

Get the schema for a given workspace.

Schema represents the internal structure of the workspace, which can be used during the query. For more information, visit: https://docs.microsoft.com/en-us/rest/api/loganalytics/workspaces%202015-03-20/getschema.

az monitor log-analytics workspace get-schema --resource-group
                                              --workspace-name
                                              [--subscription]

Examples

Get the schema for a given workspace. (autogenerated)

az monitor log-analytics workspace get-schema --resource-group MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--subscription

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

az monitor log-analytics workspace get-shared-keys

Get the shared keys for a workspace.

az monitor log-analytics workspace get-shared-keys --resource-group
                                                   --workspace-name
                                                   [--subscription]

Examples

Get the shared keys for a workspace. (autogenerated)

az monitor log-analytics workspace get-shared-keys --resource-group MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--subscription

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

az monitor log-analytics workspace list

Get a list of workspaces under a resource group or a subscription.

az monitor log-analytics workspace list [--query-examples]
                                        [--resource-group]
                                        [--subscription]

Optional Parameters

--query-examples

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.

--resource-group -g

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

--subscription

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

az monitor log-analytics workspace list-deleted-workspaces

Get a list of deleted workspaces that can be recovered in a subscription or a resource group.

az monitor log-analytics workspace list-deleted-workspaces [--resource-group]
                                                           [--subscription]

Examples

Get a list of deleted workspaces that can be recovered in a resource group

az monitor log-analytics workspace list-deleted-workspaces --resource-group MyResourceGroup

Optional Parameters

--resource-group -g

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

--subscription

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

az monitor log-analytics workspace list-management-groups

Get a list of management groups connected to a workspace.

az monitor log-analytics workspace list-management-groups --resource-group
                                                          --workspace-name
                                                          [--subscription]

Examples

Get a list of management groups connected to a workspace. (autogenerated)

az monitor log-analytics workspace list-management-groups --resource-group MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--subscription

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

az monitor log-analytics workspace list-usages

Get a list of usage metrics for a workspace.

az monitor log-analytics workspace list-usages --resource-group
                                               --workspace-name
                                               [--subscription]

Examples

Get a list of usage metrics for a workspace. (autogenerated)

az monitor log-analytics workspace list-usages --resource-group MyResourceGroup --subscription MySubscription --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--subscription

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

az monitor log-analytics workspace recover

Recover a workspace in a soft-delete state within 14 days.

az monitor log-analytics workspace recover --workspace-name
                                           [--no-wait]
                                           [--resource-group]
                                           [--subscription]

Examples

Recover a workspace in a soft-delete state within 14 days

az monitor log-analytics workspace recover --resource-group MyResourceGroup -n MyWorkspace

Required Parameters

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

--resource-group -g

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

--subscription

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

az monitor log-analytics workspace show

Show a workspace instance.

az monitor log-analytics workspace show --resource-group
                                        --workspace-name
                                        [--query-examples]
                                        [--subscription]

Examples

Show a workspace instance. (autogenerated)

az monitor log-analytics workspace show --resource-group MyResourceGroup --workspace-name MyWorkspace

Required Parameters

--resource-group -g

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

--workspace-name -n

Name of the Log Analytics Workspace.

Optional Parameters

--query-examples

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.

--subscription

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

az monitor log-analytics workspace update

Update a workspace instance.

az monitor log-analytics workspace update --resource-group
                                          --workspace-name
                                          [--add]
                                          [--capacity-reservation-level]
                                          [--force-string]
                                          [--ingestion-access {Disabled, Enabled}]
                                          [--query-access {Disabled, Enabled}]
                                          [--quota]
                                          [--remove]
                                          [--retention-time]
                                          [--set]
                                          [--subscription]
                                          [--tags]

Required Parameters

--resource-group -g

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

--workspace-name -n

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

--capacity-reservation-level --level

The capacity reservation level for this workspace, when CapacityReservation sku is selected. The maximum value is 1000 and must be in multiples of 100. If you want to increase the limit, please contact LAIngestionRate@microsoft.com.

--force-string

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

--ingestion-access

The public network access type to access workspace ingestion.

accepted values: Disabled, Enabled
--query-access

The public network access type to access workspace query.

accepted values: Disabled, Enabled
--quota

The workspace daily quota for ingestion in gigabytes. The minimum value is 0.023 and default is -1 which means unlimited.

--remove

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

--retention-time

The workspace data retention in days.

default value: 30
--set

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

--subscription

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

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.