Share via


microsoft.insights guestDiagnosticSettings

Choose a deployment language

Bicep resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following Bicep to your template.

resource symbolicname 'microsoft.insights/guestDiagnosticSettings@2018-06-01-preview' = {
  location: 'string'
  name: 'string'
  properties: {
    dataSources: [
      {
        configuration: {
          eventLogs: [
            {
              filter: 'string'
              logName: 'string'
            }
          ]
          perfCounters: [
            {
              instance: 'string'
              name: 'string'
              samplingPeriod: 'string'
            }
          ]
          providers: [
            {
              events: [
                {
                  filter: 'string'
                  id: int
                  name: 'string'
                }
              ]
              id: 'string'
            }
          ]
        }
        kind: 'string'
        sinks: [
          {
            kind: 'string'
          }
        ]
      }
    ]
    osType: 'string'
    proxySetting: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

Property values

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind 'ETWProviders'
'PerformanceCounter'
'WindowsEventLogs' (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EventLogConfiguration

Name Description Value
filter string
logName string (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration 'Linux'
'Windows'
proxySetting string

microsoft.insights/guestDiagnosticSettings

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

ResourceTags

Name Description Value

SinkConfiguration

Name Description Value
kind 'ApplicationInsights'
'EventHub'
'LogAnalytics' (required)

ARM template resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following JSON to your template.

{
  "type": "microsoft.insights/guestDiagnosticSettings",
  "apiVersion": "2018-06-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "dataSources": [
      {
        "configuration": {
          "eventLogs": [
            {
              "filter": "string",
              "logName": "string"
            }
          ],
          "perfCounters": [
            {
              "instance": "string",
              "name": "string",
              "samplingPeriod": "string"
            }
          ],
          "providers": [
            {
              "events": [
                {
                  "filter": "string",
                  "id": "int",
                  "name": "string"
                }
              ],
              "id": "string"
            }
          ]
        },
        "kind": "string",
        "sinks": [
          {
            "kind": "string"
          }
        ]
      }
    ],
    "osType": "string",
    "proxySetting": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property values

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind 'ETWProviders'
'PerformanceCounter'
'WindowsEventLogs' (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EventLogConfiguration

Name Description Value
filter string
logName string (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration 'Linux'
'Windows'
proxySetting string

microsoft.insights/guestDiagnosticSettings

Name Description Value
apiVersion The api version '2018-06-01-preview'
location Resource location string (required)
name The resource name string (required)
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'microsoft.insights/guestDiagnosticSettings'

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

ResourceTags

Name Description Value

SinkConfiguration

Name Description Value
kind 'ApplicationInsights'
'EventHub'
'LogAnalytics' (required)

Terraform (AzAPI provider) resource definition

The guestDiagnosticSettings resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a microsoft.insights/guestDiagnosticSettings resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "microsoft.insights/guestDiagnosticSettings@2018-06-01-preview"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      dataSources = [
        {
          configuration = {
            eventLogs = [
              {
                filter = "string"
                logName = "string"
              }
            ]
            perfCounters = [
              {
                instance = "string"
                name = "string"
                samplingPeriod = "string"
              }
            ]
            providers = [
              {
                events = [
                  {
                    filter = "string"
                    id = int
                    name = "string"
                  }
                ]
                id = "string"
              }
            ]
          }
          kind = "string"
          sinks = [
            {
              kind = "string"
            }
          ]
        }
      ]
      osType = "string"
      proxySetting = "string"
    }
  })
}

Property values

DataSource

Name Description Value
configuration DataSourceConfiguration (required)
kind Datasource kind 'ETWProviders'
'PerformanceCounter'
'WindowsEventLogs' (required)
sinks SinkConfiguration[] (required)

DataSourceConfiguration

Name Description Value
eventLogs Windows event logs configuration. EventLogConfiguration[]
perfCounters Performance counter configuration PerformanceCounterConfiguration[]
providers ETW providers configuration EtwProviderConfiguration[]

EtwEventConfiguration

Name Description Value
filter string
id int (required)
name string (required)

EtwProviderConfiguration

Name Description Value
events EtwEventConfiguration[] (required)
id string (required)

EventLogConfiguration

Name Description Value
filter string
logName string (required)

GuestDiagnosticSettings

Name Description Value
dataSources the array of data source object which are configured to collect and send data DataSource[]
osType Operating system type for the configuration 'Linux'
'Windows'
proxySetting string

microsoft.insights/guestDiagnosticSettings

Name Description Value
location Resource location string (required)
name The resource name string (required)
properties The diagnostic settings to be applied to azure resources. GuestDiagnosticSettings (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "microsoft.insights/guestDiagnosticSettings@2018-06-01-preview"

PerformanceCounterConfiguration

Name Description Value
instance string
name string (required)
samplingPeriod string (required)

ResourceTags

Name Description Value

SinkConfiguration

Name Description Value
kind 'ApplicationInsights'
'EventHub'
'LogAnalytics' (required)