Skip to main content

tables

Creates, updates, deletes, gets or lists a tables resource.

Overview

Nametables
TypeResource
Idazure.log_analytics.tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
archiveRetentionInDaysintegerThe tables long-term retention in days. Calculated as (totalRetentionInDays-retentionInDays).
lastPlanModifiedDatestringThe timestamp that table plan was last modified (UTC).
planstringInstruct the system how to handle and charge the logs ingested to this table. Known values are: "Basic", "Analytics", and "Auxiliary". (Basic, Analytics, Auxiliary)
provisioningStatestringTable's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing operation, forbidding any update to the table until the ongoing operation is concluded. Known values are: "Updating", "InProgress", "Succeeded", and "Deleting". (Updating, InProgress, Succeeded, Deleting)
restoredLogsobjectParameters of the restore operation that initiated this table.
resultStatisticsobjectSearch job execution statistics.
retentionInDaysintegerIn Analytics table: the tables analytics retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only property.
retentionInDaysAsDefaultbooleanTrue - Value originates from workspace retention in days, False - Customer specific.
schemaobjectTable schema.
searchResultsobjectParameters of the search job that initiated this table.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
totalRetentionInDaysintegerThe table total retention in days, between 4 and 4383. Setting this property to -1 will default to retentionInDays.
totalRetentionInDaysAsDefaultbooleanTrue - Value originates from retention in days, False - Customer specific.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, workspace_name, table_name, subscription_idGets a Log Analytics workspace table.
list_by_workspaceselectresource_group_name, workspace_name, subscription_idGets all the tables for the specified Log Analytics workspace.
create_or_updateinsertresource_group_name, workspace_name, table_name, subscription_idUpdate or Create a Log Analytics workspace table.
updateupdateresource_group_name, workspace_name, table_name, subscription_idUpdate a Log Analytics workspace table.
create_or_updatereplaceresource_group_name, workspace_name, table_name, subscription_idUpdate or Create a Log Analytics workspace table.
deletedeleteresource_group_name, workspace_name, table_name, subscription_idDelete a Log Analytics workspace table.
migrateexecresource_group_name, workspace_name, table_name, subscription_idMigrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of Data Collection Rule-based Custom Logs.
cancel_searchexecresource_group_name, workspace_name, table_name, subscription_idCancel a log analytics workspace search results table query run.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
table_namestringThe name of the table. Required.
workspace_namestringThe name of the workspace. Required.

SELECT examples

Gets a Log Analytics workspace table.

SELECT
id,
name,
archiveRetentionInDays,
lastPlanModifiedDate,
plan,
provisioningState,
restoredLogs,
resultStatistics,
retentionInDays,
retentionInDaysAsDefault,
schema,
searchResults,
systemData,
totalRetentionInDays,
totalRetentionInDaysAsDefault,
type
FROM azure.log_analytics.tables
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND workspace_name = '{{ workspace_name }}' -- required
AND table_name = '{{ table_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Update or Create a Log Analytics workspace table.

INSERT INTO azure.log_analytics.tables (
properties,
resource_group_name,
workspace_name,
table_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ workspace_name }}',
'{{ table_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

UPDATE examples

Update a Log Analytics workspace table.

UPDATE azure.log_analytics.tables
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND table_name = '{{ table_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

REPLACE examples

Update or Create a Log Analytics workspace table.

REPLACE azure.log_analytics.tables
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND table_name = '{{ table_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a Log Analytics workspace table.

DELETE FROM azure.log_analytics.tables
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND workspace_name = '{{ workspace_name }}' --required
AND table_name = '{{ table_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of Data Collection Rule-based Custom Logs.

EXEC azure.log_analytics.tables.migrate 
@resource_group_name='{{ resource_group_name }}' --required,
@workspace_name='{{ workspace_name }}' --required,
@table_name='{{ table_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;