Skip to content

Data Source: azurermMonitorDataCollectionRule

Use this data source to access information about an existing Data Collection Rule.

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const dataAzurermMonitorDataCollectionRuleExample =
  new azurerm.dataAzurermMonitorDataCollectionRule.DataAzurermMonitorDataCollectionRule(
    this,
    "example",
    {
      name: "example-rule",
      resource_group_name: "${azurerm_resource_group.example.name}",
    }
  );
new cdktf.TerraformOutput(this, "rule_id", {
  value: dataAzurermMonitorDataCollectionRuleExample.id,
});

Argument Reference

  • name - Specifies the name of the Data Collection Rule.

  • resourceGroupName - Specifies the name of the resource group the Data Collection Rule is located in.

Attributes Reference

  • id - The ID of the Resource.

  • dataFlow - One or more dataFlow blocks as defined below.

  • destinations - A destinations block as defined below.

  • location - The Azure Region where the Data Collection Rule should exist. Changing this forces a new Data Collection Rule to be created.

  • dataSources - A dataSources block as defined below. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.

  • description - The description of the Data Collection Rule.

  • kind - The kind of the Data Collection Rule. Possible values are linux and windows. A rule of kind linux does not allow for windowsEventLog data sources. And a rule of kind windows does not allow for syslog data sources. If kind is not specified, all kinds of data sources are allowed.

  • tags - A mapping of tags which should be assigned to the Data Collection Rule.


A azureMonitorMetrics block supports the following:

  • name - The name which should be used for this destination. This name should be unique across all destinations regardless of type within the Data Collection Rule.

A dataFlow block supports the following:

  • destinations - Specifies a list of destination names. A azureMonitorMetrics data source only allows for stream of kind microsoftInsightsMetrics.

  • streams - Specifies a list of streams. Possible values are microsoftEvent, microsoftInsightsMetrics, microsoftPerf, microsoftSyslog,and microsoftWindowsEvent.


A dataSources block supports the following:

  • extension - One or more extension blocks as defined below.

  • performanceCounter - One or more performanceCounter blocks as defined below.

  • syslog - One or more syslog blocks as defined below.

  • windowsEventLog - One or more windowsEventLog blocks as defined below.


A destinations block supports the following:

  • azureMonitorMetrics - A azureMonitorMetrics block as defined above.

  • logAnalytics - One or more logAnalytics blocks as defined below.


A extension block supports the following:

  • extensionName - The name of the VM extension.

  • name - The name which should be used for this data source. This name should be unique across all data sources regardless of type within the Data Collection Rule.

  • streams - Specifies a list of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. Possible values are microsoftEvent, microsoftInsightsMetrics, microsoftPerf, microsoftSyslog,and microsoftWindowsEvent.

  • extensionJson - A JSON String which specifies the extension setting.

  • inputDataSources - Specifies a list of data sources this extension needs data from. An item should be a name of a supported data source which produces only one stream. Supported data sources type: performanceCounter, windowsEventLog,and syslog.


A logAnalytics block supports the following:

  • name - The name which should be used for this destination. This name should be unique across all destinations regardless of type within the Data Collection Rule.

  • workspaceResourceId - The ID of a Log Analytic Workspace resource.


A performanceCounter block supports the following:

  • counterSpecifiers - Specifies a list of specifier names of the performance counters you want to collect. Use a wildcard * to collect counters for all instances. To get a list of performance counters on Windows, run the command typeperf.

  • name - The name which should be used for this data source. This name should be unique across all data sources regardless of type within the Data Collection Rule.

  • samplingFrequencyInSeconds - The number of seconds between consecutive counter measurements (samples). The value should be integer between 1 and 300 inclusive.

  • streams - Specifies a list of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. Possible values are microsoftInsightsMetrics,and microsoftPerf.


A syslog block supports the following:

  • facilityNames - Specifies a list of facility names. Use a wildcard * to collect logs for all facility names. Possible values are auth, authpriv, cron, daemon, kern, lpr, mail, mark, news, syslog, user, uucp, local0, local1, local2, local3, local4, local5, local6, local7,and *.

  • logLevels - Specifies a list of log levels. Use a wildcard * to collect logs for all log levels. Possible values are debug, info, notice, warning, error, critical, alert, emergency,and *.

  • name - The name which should be used for this data source. This name should be unique across all data sources regardless of type within the Data Collection Rule.

-> Note: Syslog data source has only one possible streams value which is microsoftSyslog.


A windowsEventLog block supports the following:

  • name - The name which should be used for this data source. This name should be unique across all data sources regardless of type within the Data Collection Rule.

  • streams - Specifies a list of streams that this data source will be sent to. A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. Possible values are microsoftEvent,and microsoftWindowsEvent.

  • xPathQueries - Specifies a list of Windows Event Log queries in XPath expression.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the Data Collection Rule.