Skip to main content

data_collection_rules

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

Overview

Namedata_collection_rules
TypeResource
Idazure.monitor.data_collection_rules

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.
agentSettingsobjectAgent settings used to modify agent behavior on a given host.
dataCollectionEndpointIdstringThe resource ID of the data collection endpoint that this rule can be used with.
dataFlowsarrayThe specification of data flows.
dataSourcesobjectThe specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
descriptionstringDescription of the data collection rule.
destinationsobjectThe specification of destinations.
directDataSourcesobjectThe specification of direct data sources. This property is optional and can be omitted.
endpointsobjectDefines the ingestion endpoints to send data to via this rule.
etagstringResource entity tag (ETag).
identityobjectManaged service identity of the resource.
immutableIdstringThe immutable ID of this data collection rule. This property is READ-ONLY.
ingestionQuotasobjectThe specification for ingestion limits.
kindstringThe kind of the resource. Known values are: "Linux" and "Windows". (Linux, Windows)
locationstringThe geo-location where the resource lives. Required.
metadataobjectMetadata about the resource.
provisioningStatestringThe resource provisioning state. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed". (Creating, Updating, Deleting, Succeeded, Canceled, Failed)
referencesobjectDefines all the references that may be used in other sections of the DCR.
skuobjectThe SKU of the resource.
streamDeclarationsobjectDeclaration of custom streams used in this rule.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
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, data_collection_rule_name, subscription_idReturns the specified data collection rule. Returns the specified data collection rule.
list_by_resource_groupselectresource_group_name, subscription_idLists all data collection rules in the specified resource group. Lists all data collection rules in the specified resource group.
list_by_subscriptionselectsubscription_idLists all data collection rules in the specified subscription. Lists all data collection rules in the specified subscription.
createinsertresource_group_name, data_collection_rule_name, subscription_id, locationCreates or updates a data collection rule. Creates or updates a data collection rule.
updateupdateresource_group_name, data_collection_rule_name, subscription_idUpdates part of a data collection rule. Updates part of a data collection rule.
deletedeleteresource_group_name, data_collection_rule_name, subscription_iddeleteAssociationsDeletes a data collection rule. Deletes a data collection rule.

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
data_collection_rule_namestringThe name of the data collection rule. The name is case insensitive. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
subscription_idstring
deleteAssociationsbooleanIf set to 'true' then all associations of this data collection rule will also be deleted. Default value is None.

SELECT examples

Returns the specified data collection rule. Returns the specified data collection rule.

SELECT
id,
name,
agentSettings,
dataCollectionEndpointId,
dataFlows,
dataSources,
description,
destinations,
directDataSources,
endpoints,
etag,
identity,
immutableId,
ingestionQuotas,
kind,
location,
metadata,
provisioningState,
references,
sku,
streamDeclarations,
systemData,
tags,
type
FROM azure.monitor.data_collection_rules
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND data_collection_rule_name = '{{ data_collection_rule_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a data collection rule. Creates or updates a data collection rule.

INSERT INTO azure.monitor.data_collection_rules (
tags,
location,
properties,
kind,
sku,
identity,
resource_group_name,
data_collection_rule_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ kind }}',
'{{ sku }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ data_collection_rule_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
identity,
kind,
location,
properties,
sku,
systemData,
tags,
type
;

UPDATE examples

Updates part of a data collection rule. Updates part of a data collection rule.

UPDATE azure.monitor.data_collection_rules
SET
tags = '{{ tags }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND data_collection_rule_name = '{{ data_collection_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
identity,
kind,
location,
properties,
sku,
systemData,
tags,
type;

DELETE examples

Deletes a data collection rule. Deletes a data collection rule.

DELETE FROM azure.monitor.data_collection_rules
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND data_collection_rule_name = '{{ data_collection_rule_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND deleteAssociations = '{{ deleteAssociations }}'
;