共用方式為


Microsoft.Insights dataCollectionRules 2022-06-01

Bicep 資源定義

dataCollectionRules 資源類型可以使用目標作業進行部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Insights/dataCollectionRules 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Insights/dataCollectionRules@2022-06-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  kind: 'string'
  identity: {
    type: 'string'
    userAssignedIdentities: {}
  }
  properties: {
    dataCollectionEndpointId: 'string'
    dataFlows: [
      {
        builtInTransform: 'string'
        destinations: [
          'string'
        ]
        outputStream: 'string'
        streams: [
          'string'
        ]
        transformKql: 'string'
      }
    ]
    dataSources: {
      dataImports: {
        eventHub: {
          consumerGroup: 'string'
          name: 'string'
          stream: 'string'
        }
      }
      extensions: [
        {
          extensionName: 'string'
          extensionSettings: any()
          inputDataSources: [
            'string'
          ]
          name: 'string'
          streams: [
            'string'
          ]
        }
      ]
      iisLogs: [
        {
          logDirectories: [
            'string'
          ]
          name: 'string'
          streams: [
            'string'
          ]
        }
      ]
      logFiles: [
        {
          filePatterns: [
            'string'
          ]
          format: 'text'
          name: 'string'
          settings: {
            text: {
              recordStartTimestampFormat: 'string'
            }
          }
          streams: [
            'string'
          ]
        }
      ]
      performanceCounters: [
        {
          counterSpecifiers: [
            'string'
          ]
          name: 'string'
          samplingFrequencyInSeconds: int
          streams: [
            'string'
          ]
        }
      ]
      platformTelemetry: [
        {
          name: 'string'
          streams: [
            'string'
          ]
        }
      ]
      prometheusForwarder: [
        {
          labelIncludeFilter: {}
          name: 'string'
          streams: 'Microsoft-PrometheusMetrics'
        }
      ]
      syslog: [
        {
          facilityNames: [
            'string'
          ]
          logLevels: [
            'string'
          ]
          name: 'string'
          streams: 'Microsoft-Syslog'
        }
      ]
      windowsEventLogs: [
        {
          name: 'string'
          streams: [
            'string'
          ]
          xPathQueries: [
            'string'
          ]
        }
      ]
      windowsFirewallLogs: [
        {
          name: 'string'
          streams: [
            'string'
          ]
        }
      ]
    }
    description: 'string'
    destinations: {
      azureMonitorMetrics: {
        name: 'string'
      }
      eventHubs: [
        {
          eventHubResourceId: 'string'
          name: 'string'
        }
      ]
      eventHubsDirect: [
        {
          eventHubResourceId: 'string'
          name: 'string'
        }
      ]
      logAnalytics: [
        {
          name: 'string'
          workspaceResourceId: 'string'
        }
      ]
      monitoringAccounts: [
        {
          accountResourceId: 'string'
          name: 'string'
        }
      ]
      storageAccounts: [
        {
          containerName: 'string'
          name: 'string'
          storageAccountResourceId: 'string'
        }
      ]
      storageBlobsDirect: [
        {
          containerName: 'string'
          name: 'string'
          storageAccountResourceId: 'string'
        }
      ]
      storageTablesDirect: [
        {
          name: 'string'
          storageAccountResourceId: 'string'
          tableName: 'string'
        }
      ]
    }
    streamDeclarations: {}
  }
}

屬性值

dataCollectionRules

名稱 描述
NAME 資源名稱 需要字串 ()
location 資源所在的地理位置。 需要字串 ()
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標籤
kind 資源的種類。 'Linux'
'Windows'
身分識別 資源的受控服務識別。 DataCollectionRuleResourceIdentity
properties 資源屬性。 DataCollectionRuleResourceProperties

DataCollectionRuleResourceIdentity

名稱 描述
類型 (允許 SystemAssigned 和 UserAssigned 類型的受控服務識別類型) 。 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned' (必要)
userAssignedIdentities 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中 ({}) 的空白物件。 物件 (object)

DataCollectionRuleResourceProperties

名稱 描述
dataCollectionEndpointId 此規則可以搭配使用的數據收集端點資源標識碼。 字串
dataFlows 數據流的規格。 DataFlow[]
dataSources 數據源的規格。
此屬性是選擇性的,如果規則是要透過對已布建端點的直接呼叫來使用,則可以省略此屬性。
DataCollectionRuleDataSources
description 數據收集規則的描述。 字串
目的地 目的地的規格。 DataCollectionRuleDestinations
streamDeclarations 此規則中使用的自定義數據流宣告。 物件 (object)

數據流

名稱 描述
builtInTransform 用來轉換數據流數據的 builtIn 轉換 字串
目的地 此數據流的目的地清單。 string[]
outputStream 轉換的輸出數據流。 只有在轉換將數據變更為不同的數據流時才需要。 字串
資料流 此數據流的數據流清單。 包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-InsightsMetrics'
'Microsoft-Perf'
'Microsoft-Syslog'
'Microsoft-WindowsEvent'
transformKql 用來轉換數據流數據的 KQL 查詢。 字串

DataCollectionRuleDataSources

名稱 描述
dataImports 提取型數據源的規格 DataSourcesSpecDataImports
擴充功能 Azure VM 擴充功能數據源組態的清單。 ExtensionDataSource[]
iisLogs IIS 記錄來源組態的清單。 IisLogsDataSource[]
logFiles 記錄檔來源組態的清單。 LogFilesDataSource[]
performanceCounters 性能計數器數據源組態的清單。 PerfCounterDataSource[]
platformTelemetry 平台遙測組態的清單 PlatformTelemetryDataSource[]
prometheusForwarder Prometheus 轉寄站數據源組態的清單。 PrometheusForwarderDataSource[]
syslog Syslog 資料源組態的清單。 SyslogDataSource[]
windowsEventLogs Windows 事件記錄檔數據源組態的清單。 WindowsEventLogDataSource[]
windowsFirewallLogs Windows 防火牆記錄來源組態的清單。 WindowsFirewallLogsDataSource[]

DataSourcesSpecDataImports

名稱 描述
eventHub 事件中樞設定的定義。 DataImportSourcesEventHub

DataImportSourcesEventHub

名稱 描述
consumerGroup 事件中樞取用者組名 字串
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 要從 EventHub 收集的數據流 字串

ExtensionDataSource

名稱 描述
extensionName VM 擴充功能的名稱。 需要字串 ()
extensionSettings 擴充功能設定。 此格式是特定延伸模組的特定格式。 針對 Bicep,您可以使用 any () 函式。
inputDataSources 此延伸模組需要數據的來源數據來源清單。 string[]
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-InsightsMetrics'
'Microsoft-Perf'
'Microsoft-Syslog'
'Microsoft-WindowsEvent'

IisLogsDataSource

名稱 描述
logDirectories 絕對路徑檔案位置 string[]
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 IIS 數據流 string[] (必要)

LogFilesDataSource

名稱 描述
filePatterns 記錄檔所在的檔案模式 string[] (必要)
format 記錄檔的數據格式 'text' (必要)
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
設定 記錄檔特定設定。 LogFilesDataSourceSettings
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據源的架構
string[] (必要)

LogFilesDataSourceSettings

名稱 描述
text 文字設定 LogFileSettingsText

LogFileSettingsText

名稱 描述
recordStartTimestampFormat MM:SS AM/PM' 、'MMM d hh:mm:ss' 、'Mon DD、 YYYY HH:MM:SS' 、'YYYY-MM-DD HH:MM:SS' 、'dd/MMM/yyyy:HH:mm:ss zzz' 、'ddMMyy HH:mm:ss' 、'yyMMdd HH:mm:ss' 、'yyyy-MM-ddTHH:mm:ssK' 、字符串 (必要) :其中一種支持的時間戳格式 'ISO 8601'
'M/D/YYYY HH (必要)

PerfCounterDataSource

名稱 描述
counterSpecifiers 您想要收集之性能計數器的規範名稱清單。
使用通配符 (*) 來收集所有實例的計數器。
若要取得 Windows 上的性能計數器清單,請執行命令 『typeperf』。
string[]
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
samplingFrequencyInSeconds 連續計數器測量之間的秒數, (樣本) 。 int
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-InsightsMetrics'
'Microsoft-Perf'

PlatformTelemetryDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 要收集的平臺遙測數據流清單 string[] (必要)

PrometheusForwarderDataSource

名稱 描述
labelIncludeFilter 標籤包含篩選的清單,格式為標籤 “name-value” 組。
目前僅支援一個標籤:『microsoft_metrics_include_label』。
標籤值不區分大小寫。
物件 (object)
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。 包含任何項目的字串數組:
'Microsoft-PrometheusMetrics'

SyslogDataSource

名稱 描述
facilityNames 設施名稱的清單。 包含任何項目的字串數組:
'*'
'auth'
'authpriv'
'cron'
'daemon'
'kern'
'local0'
'local1'
'local2'
'local3'
'local4'
'local5'
'local6'
'local7'
'lpr'
'mail'
'mark'
'news'
'syslog'
'user'
'uucp'
logLevels 要收集的記錄層級。 包含任何項目的字串數組:
'*'
'Alert'
'Critical'
'Debug'
'Emergency'
'Error'
'Info'
'Notice'
'Warning'
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據的架構,而且通常會在Log Analytics中傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Syslog'

WindowsEventLogDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據的架構,而且通常會在Log Analytics中傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-WindowsEvent'
xPathQueries XPATH 格式的 Windows 事件記錄檔查詢清單。 string[]

WindowsFirewallLogsDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 防火牆記錄數據流 string[] (必要)

DataCollectionRuleDestinations

名稱 描述
azureMonitorMetrics Azure 監視器計量目的地。 DestinationsSpecAzureMonitorMetrics
eventHubs 事件中樞目的地的清單。 EventHubDestination[]
eventHubsDirect 事件中樞直接目的地的清單。 EventHubDirectDestination[]
logAnalytics Log Analytics 目的地的清單。 LogAnalyticsDestination[]
monitoringAccounts 監視帳戶目的地的清單。 MonitoringAccountDestination[]
storageAccounts 記憶體帳戶目的地的清單。 StorageBlobDestination[]
storageBlobsDirect 記憶體 Blob 直接目的地的清單。 僅用於直接從代理程式傳送數據以儲存數據。 StorageBlobDestination[]
storageTablesDirect 記憶體數據表直接目的地的清單。 StorageTableDestination[]

DestinationsSpecAzureMonitorMetrics

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串

EventHubDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串

EventHubDirectDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串

LogAnalyticsDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
workspaceResourceId Log Analytics 工作區的資源標識碼。 字串

MonitoringAccountDestination

名稱 描述
accountResourceId 監視帳戶的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串

StorageBlobDestination

名稱 描述
containerName 記憶體 Blob 的容器名稱。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串

StorageTableDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串
tableName 記憶體數據表的名稱。 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
部署深色追蹤自動調整 vSensors

部署至 Azure
此範本可讓您部署 Darktrace vSensors 的自動自動調整部署
Syslog 的數據收集規則

部署至 Azure
此範本會建立定義數據源的數據收集規則, (Syslog) 和目的地工作區。

ARM 範本資源定義

dataCollectionRules 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.Insights/dataCollectionRules 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.Insights/dataCollectionRules",
  "apiVersion": "2022-06-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "kind": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {}
  },
  "properties": {
    "dataCollectionEndpointId": "string",
    "dataFlows": [
      {
        "builtInTransform": "string",
        "destinations": [ "string" ],
        "outputStream": "string",
        "streams": [ "string" ],
        "transformKql": "string"
      }
    ],
    "dataSources": {
      "dataImports": {
        "eventHub": {
          "consumerGroup": "string",
          "name": "string",
          "stream": "string"
        }
      },
      "extensions": [
        {
          "extensionName": "string",
          "extensionSettings": {},
          "inputDataSources": [ "string" ],
          "name": "string",
          "streams": [ "string" ]
        }
      ],
      "iisLogs": [
        {
          "logDirectories": [ "string" ],
          "name": "string",
          "streams": [ "string" ]
        }
      ],
      "logFiles": [
        {
          "filePatterns": [ "string" ],
          "format": "text",
          "name": "string",
          "settings": {
            "text": {
              "recordStartTimestampFormat": "string"
            }
          },
          "streams": [ "string" ]
        }
      ],
      "performanceCounters": [
        {
          "counterSpecifiers": [ "string" ],
          "name": "string",
          "samplingFrequencyInSeconds": "int",
          "streams": [ "string" ]
        }
      ],
      "platformTelemetry": [
        {
          "name": "string",
          "streams": [ "string" ]
        }
      ],
      "prometheusForwarder": [
        {
          "labelIncludeFilter": {},
          "name": "string",
          "streams": "Microsoft-PrometheusMetrics"
        }
      ],
      "syslog": [
        {
          "facilityNames": [ "string" ],
          "logLevels": [ "string" ],
          "name": "string",
          "streams": "Microsoft-Syslog"
        }
      ],
      "windowsEventLogs": [
        {
          "name": "string",
          "streams": [ "string" ],
          "xPathQueries": [ "string" ]
        }
      ],
      "windowsFirewallLogs": [
        {
          "name": "string",
          "streams": [ "string" ]
        }
      ]
    },
    "description": "string",
    "destinations": {
      "azureMonitorMetrics": {
        "name": "string"
      },
      "eventHubs": [
        {
          "eventHubResourceId": "string",
          "name": "string"
        }
      ],
      "eventHubsDirect": [
        {
          "eventHubResourceId": "string",
          "name": "string"
        }
      ],
      "logAnalytics": [
        {
          "name": "string",
          "workspaceResourceId": "string"
        }
      ],
      "monitoringAccounts": [
        {
          "accountResourceId": "string",
          "name": "string"
        }
      ],
      "storageAccounts": [
        {
          "containerName": "string",
          "name": "string",
          "storageAccountResourceId": "string"
        }
      ],
      "storageBlobsDirect": [
        {
          "containerName": "string",
          "name": "string",
          "storageAccountResourceId": "string"
        }
      ],
      "storageTablesDirect": [
        {
          "name": "string",
          "storageAccountResourceId": "string",
          "tableName": "string"
        }
      ]
    },
    "streamDeclarations": {}
  }
}

屬性值

dataCollectionRules

名稱 描述
類型 資源類型 'Microsoft.Insights/dataCollectionRules'
apiVersion 資源 API 版本 '2022-06-01'
NAME 資源名稱 字串 (必要)
location 資源所在的地理位置。 字串 (必要)
tags 資源標籤。 標記名稱和值的字典。 請參閱 範本中的標記
kind 資源的種類。 'Linux'
'Windows'
身分識別 資源的受控服務識別。 DataCollectionRuleResourceIdentity
properties 資源屬性。 DataCollectionRuleResourceProperties

DataCollectionRuleResourceIdentity

名稱 描述
類型 (允許 SystemAssigned 和 UserAssigned 類型的受控服務識別類型) 。 'None'
'SystemAssigned'
'SystemAssigned,UserAssigned'
'UserAssigned' (必要)
userAssignedIdentities 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中 () 的空白物件 {} 。 物件 (object)

DataCollectionRuleResourceProperties

名稱 描述
dataCollectionEndpointId 此規則可以搭配使用的數據收集端點資源標識碼。 字串
dataFlows 數據流的規格。 數據流[]
dataSources 數據源的規格。
此屬性是選擇性的,如果規則是要透過對已布建端點的直接呼叫使用,則可以省略此屬性。
DataCollectionRuleDataSources
description 數據收集規則的描述。 字串
目的地 目的地的規格。 DataCollectionRuleDestinations
streamDeclarations 此規則中使用的自定義數據流宣告。 物件 (object)

數據流

名稱 描述
builtInTransform 用來轉換數據流數據的 builtIn 轉換 字串
目的地 此數據流的目的地清單。 string[]
outputStream 轉換的輸出數據流。 只有在轉換將數據變更為不同的數據流時,才需要。 字串
資料流 此數據流的數據流清單。 包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-InsightsMetrics'
'Microsoft-Perf'
'Microsoft-Syslog'
'Microsoft-WindowsEvent'
transformKql 要轉換數據流數據的 KQL 查詢。 字串

DataCollectionRuleDataSources

名稱 描述
dataImports 提取式數據源的規格 DataSourcesSpecDataImports
擴充功能 Azure VM 延伸模組數據源組態的清單。 ExtensionDataSource[]
iisLogs IIS 記錄來源組態的清單。 IisLogsDataSource[]
logFiles 記錄檔來源組態的清單。 LogFilesDataSource[]
performanceCounters 性能計數器數據源組態的清單。 PerfCounterDataSource[]
platformTelemetry 平台遙測組態的清單 PlatformTelemetryDataSource[]
prometheusForwarder Prometheus 轉寄站數據源組態的清單。 PrometheusForwarderDataSource[]
syslog Syslog 資料源組態的清單。 SyslogDataSource[]
windowsEventLogs Windows 事件記錄檔數據源組態的清單。 WindowsEventLogDataSource[]
windowsFirewallLogs Windows 防火牆記錄來源設定的清單。 WindowsFirewallLogsDataSource[]

DataSourcesSpecDataImports

名稱 描述
eventHub 事件中樞組態的定義。 DataImportSourcesEventHub

DataImportSourcesEventHub

名稱 描述
consumerGroup 事件中樞取用者組名 字串
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 要從 EventHub 收集的數據流 字串

ExtensionDataSource

名稱 描述
extensionName VM 擴充功能的名稱。 字串 (必要)
extensionSettings 擴充功能設定。 此格式是特定延伸模組的特定格式。
inputDataSources 此延伸模組需要數據的來源數據來源清單。 string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據的架構,而且通常會在Log Analytics中傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-InsightsMetrics'
'Microsoft-Perf'
'Microsoft-Syslog'
'Microsoft-WindowsEvent'

IisLogsDataSource

名稱 描述
logDirectories 絕對路徑檔案位置 string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 IIS 數據流 string[] (必要)

LogFilesDataSource

名稱 描述
filePatterns 記錄檔所在的檔案模式 string[] (必要)
format 記錄檔的數據格式 'text' (必要)
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
設定 記錄檔特定設定。 LogFilesDataSourceSettings
資料流 此數據源將傳送至的數據流清單。
數據流表示將用於此數據源的架構
string[] (必要)

LogFilesDataSourceSettings

名稱 描述
text 文字設定 LogFileSettingsText

LogFileSettingsText

名稱 描述
recordStartTimestampFormat MM:SS AM/PM' 、'MMM d hh:mm:ss' 、'Mon DD、 YYYY HH:MM:SS' 、'YYYY-MM-DD HH:MM:SS' 、'dd/MMM/yyyy:HH:mm:ss zzz' 、'ddMMyy HH:mm:ss' 、'yyMMdd HH:mm:ss' 、'yyyy-MM-ddTHH:mm:ssK' 、字符串 (必要) :其中一種支持的時間戳格式 'ISO 8601'
'M/D/YYYY HH (必要)

PerfCounterDataSource

名稱 描述
counterSpecifiers 您想要收集之性能計數器的規範名稱清單。
使用通配符 (*) 收集所有實例的計數器。
若要取得 Windows 上的性能計數器清單,請執行命令 『typeperf』。
string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
samplingFrequencyInSeconds 連續計數器測量之間的秒數 (樣本) 。 int
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據的架構,而且通常會在Log Analytics中傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-InsightsMetrics'
'Microsoft-Perf'

PlatformTelemetryDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 要收集的平臺遙測數據流清單 string[] (必要)

PrometheusForwarderDataSource

名稱 描述
labelIncludeFilter 標籤包含篩選的清單,格式為標籤 “name-value” 組。
目前僅支援一個標籤:『microsoft_metrics_include_label』。
標籤值不區分大小寫。
物件 (object)
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 此數據源將傳送至的數據流清單。 包含任何項目的字串數組:
'Microsoft-PrometheusMetrics'

SyslogDataSource

名稱 描述
facilityNames 設施名稱的清單。 包含任何項目的字串數組:
'*'
'auth'
'authpriv'
'cron'
'精靈'
'kern'
'local0'
'local1'
'local2'
'local3'
'local4'
'local5'
'local6'
'local7'
'lpr'
'mail'
'mark'
'news'
'syslog'
'user'
'uucp'
logLevels 要收集的記錄層級。 包含任何項目的字串數組:
'*'
'Alert'
'Critical'
'Debug'
'Emergency'
'Error'
'Info'
'Notice'
'Warning'
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Syslog'

WindowsEventLogDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
'Microsoft-Event'
'Microsoft-WindowsEvent'
xPathQueries XPATH 格式的 Windows 事件記錄檔查詢清單。 string[]

WindowsFirewallLogsDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 防火牆記錄數據流 string[] (必要)

DataCollectionRuleDestinations

名稱 描述
azureMonitorMetrics Azure 監視器計量目的地。 DestinationsSpecAzureMonitorMetrics
eventHubs 事件中樞目的地的清單。 EventHubDestination[]
eventHubsDirect 事件中樞直接目的地的清單。 EventHubDirectDestination[]
logAnalytics Log Analytics 目的地的清單。 LogAnalyticsDestination[]
monitoringAccounts 監視帳戶目的地的清單。 MonitoringAccountDestination[]
storageAccounts 記憶體帳戶目的地的清單。 StorageBlobDestination[]
storageBlobsDirect 記憶體 Blob 直接目的地的清單。 僅用於直接從代理程式傳送數據以儲存數據。 StorageBlobDestination[]
storageTablesDirect 記憶體數據表直接目的地的清單。 StorageTableDestination[]

DestinationsSpecAzureMonitorMetrics

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

EventHubDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

EventHubDirectDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

LogAnalyticsDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
workspaceResourceId Log Analytics 工作區的資源標識碼。 字串

MonitoringAccountDestination

名稱 描述
accountResourceId 監視帳戶的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串

StorageBlobDestination

名稱 描述
containerName 記憶體 Blob 的容器名稱。 字串
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串

StorageTableDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串
tableName 記憶體數據表的名稱。 字串

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
部署深色追蹤自動調整 vSensors

部署至 Azure
此範本可讓您部署 Darktrace vSensors 的自動自動調整部署
Syslog 的數據收集規則

部署至 Azure
此範本會建立定義數據源的數據收集規則, (Syslog) 和目的地工作區。

Terraform (AzAPI 提供者) 資源定義

dataCollectionRules 資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.Insights/dataCollectionRules 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Insights/dataCollectionRules@2022-06-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type = "string"
    identity_ids = []
  }
  body = jsonencode({
    properties = {
      dataCollectionEndpointId = "string"
      dataFlows = [
        {
          builtInTransform = "string"
          destinations = [
            "string"
          ]
          outputStream = "string"
          streams = [
            "string"
          ]
          transformKql = "string"
        }
      ]
      dataSources = {
        dataImports = {
          eventHub = {
            consumerGroup = "string"
            name = "string"
            stream = "string"
          }
        }
        extensions = [
          {
            extensionName = "string"
            inputDataSources = [
              "string"
            ]
            name = "string"
            streams = [
              "string"
            ]
          }
        ]
        iisLogs = [
          {
            logDirectories = [
              "string"
            ]
            name = "string"
            streams = [
              "string"
            ]
          }
        ]
        logFiles = [
          {
            filePatterns = [
              "string"
            ]
            format = "text"
            name = "string"
            settings = {
              text = {
                recordStartTimestampFormat = "string"
              }
            }
            streams = [
              "string"
            ]
          }
        ]
        performanceCounters = [
          {
            counterSpecifiers = [
              "string"
            ]
            name = "string"
            samplingFrequencyInSeconds = int
            streams = [
              "string"
            ]
          }
        ]
        platformTelemetry = [
          {
            name = "string"
            streams = [
              "string"
            ]
          }
        ]
        prometheusForwarder = [
          {
            labelIncludeFilter = {}
            name = "string"
            streams = "Microsoft-PrometheusMetrics"
          }
        ]
        syslog = [
          {
            facilityNames = [
              "string"
            ]
            logLevels = [
              "string"
            ]
            name = "string"
            streams = "Microsoft-Syslog"
          }
        ]
        windowsEventLogs = [
          {
            name = "string"
            streams = [
              "string"
            ]
            xPathQueries = [
              "string"
            ]
          }
        ]
        windowsFirewallLogs = [
          {
            name = "string"
            streams = [
              "string"
            ]
          }
        ]
      }
      description = "string"
      destinations = {
        azureMonitorMetrics = {
          name = "string"
        }
        eventHubs = [
          {
            eventHubResourceId = "string"
            name = "string"
          }
        ]
        eventHubsDirect = [
          {
            eventHubResourceId = "string"
            name = "string"
          }
        ]
        logAnalytics = [
          {
            name = "string"
            workspaceResourceId = "string"
          }
        ]
        monitoringAccounts = [
          {
            accountResourceId = "string"
            name = "string"
          }
        ]
        storageAccounts = [
          {
            containerName = "string"
            name = "string"
            storageAccountResourceId = "string"
          }
        ]
        storageBlobsDirect = [
          {
            containerName = "string"
            name = "string"
            storageAccountResourceId = "string"
          }
        ]
        storageTablesDirect = [
          {
            name = "string"
            storageAccountResourceId = "string"
            tableName = "string"
          }
        ]
      }
      streamDeclarations = {}
    }
    kind = "string"
  })
}

屬性值

dataCollectionRules

名稱 描述
類型 資源類型 “Microsoft.Insights/dataCollectionRules@2022-06-01”
NAME 資源名稱 字串 (必要)
location 資源所在的地理位置。 字串 (必要)
parent_id 若要部署至資源群組,請使用該資源群組的標識碼。 字串 (必要)
tags 資源標籤。 標記名稱和值的字典。
kind 資源的種類。 "Linux"
"Windows"
身分識別 資源的受控服務識別。 DataCollectionRuleResourceIdentity
properties 資源屬性。 DataCollectionRuleResourceProperties

DataCollectionRuleResourceIdentity

名稱 描述
類型 (允許 SystemAssigned 和 UserAssigned 類型的受控服務識別類型) 。 “SystemAssigned”
“SystemAssigned,UserAssigned”
) 所需的 「UserAssigned」 (
identity_ids 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中 ({}) 的空白物件。 使用者身分識別標識碼的陣列。

DataCollectionRuleResourceProperties

名稱 描述
dataCollectionEndpointId 此規則可以搭配使用的數據收集端點資源標識碼。 字串
dataFlows 數據流的規格。 DataFlow[]
dataSources 數據源的規格。
此屬性是選擇性的,如果規則是要透過對已布建端點的直接呼叫來使用,則可以省略此屬性。
DataCollectionRuleDataSources
description 數據收集規則的描述。 字串
目的地 目的地的規格。 DataCollectionRuleDestinations
streamDeclarations 此規則中使用的自定義數據流宣告。 物件 (object)

數據流

名稱 描述
builtInTransform 用來轉換數據流數據的 builtIn 轉換 字串
目的地 此數據流的目的地清單。 string[]
outputStream 轉換的輸出數據流。 只有在轉換將數據變更為不同的數據流時才需要。 字串
資料流 此數據流的數據流清單。 包含任何項目的字串數組:
“Microsoft-Event”
“Microsoft-InsightsMetrics”
“Microsoft-Perf”
“Microsoft-Syslog”
“Microsoft-WindowsEvent”
transformKql 用來轉換數據流數據的 KQL 查詢。 字串

DataCollectionRuleDataSources

名稱 描述
dataImports 提取型數據源的規格 DataSourcesSpecDataImports
擴充功能 Azure VM 擴充功能數據源組態的清單。 ExtensionDataSource[]
iisLogs IIS 記錄來源組態的清單。 IisLogsDataSource[]
logFiles 記錄檔來源組態的清單。 LogFilesDataSource[]
performanceCounters 性能計數器數據源組態的清單。 PerfCounterDataSource[]
platformTelemetry 平台遙測組態的清單 PlatformTelemetryDataSource[]
prometheusForwarder Prometheus 轉寄站數據源組態的清單。 PrometheusForwarderDataSource[]
syslog Syslog 資料源組態的清單。 SyslogDataSource[]
windowsEventLogs Windows 事件記錄檔數據源組態的清單。 WindowsEventLogDataSource[]
windowsFirewallLogs Windows 防火牆記錄來源組態的清單。 WindowsFirewallLogsDataSource[]

DataSourcesSpecDataImports

名稱 描述
eventHub 事件中樞設定的定義。 DataImportSourcesEventHub

DataImportSourcesEventHub

名稱 描述
consumerGroup 事件中樞取用者組名 字串
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 要從 EventHub 收集的數據流 字串

ExtensionDataSource

名稱 描述
extensionName VM 擴充功能的名稱。 字串 (必要)
extensionSettings 擴充功能設定。 此格式是特定延伸模組的特定格式。
inputDataSources 此延伸模組需要數據的來源數據來源清單。 string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 此數據源將傳送至的數據流清單。
數據流指出將用於此數據的架構,而且通常會在Log Analytics中傳送數據的數據表。
包含任何項目的字串數組:
“Microsoft-Event”
“Microsoft-InsightsMetrics”
“Microsoft-Perf”
“Microsoft-Syslog”
“Microsoft-WindowsEvent”

IisLogsDataSource

名稱 描述
logDirectories 絕對路徑檔案位置 string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
資料流 IIS 數據流 string[] (必要)

LogFilesDataSource

名稱 描述
filePatterns 記錄檔所在的檔案模式 string[] (必要)
format 記錄檔的數據格式 “text” (必要)
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
設定 記錄檔特定設定。 LogFilesDataSourceSettings
資料流 此數據源將傳送至的數據流清單。
數據流表示將用於此數據源的架構
string[] (必要)

LogFilesDataSourceSettings

名稱 描述
text 文字設定 LogFileSettingsText

LogFileSettingsText

名稱 描述
recordStartTimestampFormat MM:SS AM/PM' 、'MMM d hh:mm:ss' 、'Mon DD、 YYYY HH:MM:SS' 、'YYYY-MM-DD HH:MM:SS' 、'dd/MMM/yyyy:HH:mm:ss zzz' 、'ddMMyy HH:mm:ss' 、'yyMMdd HH:mm:ss' 、'yyyy-MM-ddTHH:mm:ssK' 、字符串 (必要) :其中一種支持的時間戳格式 “ISO 8601”
“需要 M/D/YYYY HH ()

PerfCounterDataSource

名稱 描述
counterSpecifiers 您想要收集之性能計數器的規範名稱清單。
使用通配符 (*) 收集所有實例的計數器。
若要取得 Windows 上的性能計數器清單,請執行命令 『typeperf』。
string[]
NAME 數據源的易記名稱。
不論數據收集規則中) 類型為何,此名稱在所有數據源中都應該是唯一的 (。
字串
samplingFrequencyInSeconds 連續計數器測量之間的秒數 (樣本) 。 int
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
“Microsoft-InsightsMetrics”
“Microsoft-Perf”

PlatformTelemetryDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 要收集的平臺遙測數據流清單 string[] (必要)

PrometheusForwarderDataSource

名稱 描述
labelIncludeFilter 標籤包含篩選的清單,格式為標籤 “name-value” 組。
目前僅支援一個標籤:『microsoft_metrics_include_label』。
標籤值不區分大小寫。
物件 (object)
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。 包含任何項目的字串數組:
“Microsoft-PrometheusMetrics”

SyslogDataSource

名稱 描述
facilityNames 設施名稱的清單。 包含任何項目的字串數組:
"*"
“auth”
“authpriv”
“cron”
“精靈”
“kern”
“local0”
“local1”
“local2”
“local3”
“local4”
“local5”
“local6”
“local7”
“lpr”
“mail”
“mark”
“news”
“syslog”
「使用者」
“uucp”
logLevels 要收集的記錄層級。 包含任何項目的字串數組:
"*"
“Alert”
“Critical”
“Debug”
“緊急”
“錯誤”
“Info”
“注意事項”
「警告」
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
“Microsoft-Syslog”

WindowsEventLogDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 此數據源將傳送至的數據流清單。
數據流會指出將用於此數據的架構,以及Log Analytics中要傳送數據的數據表。
包含任何項目的字串數組:
“Microsoft-Event”
“Microsoft-WindowsEvent”
xPathQueries XPATH 格式的 Windows 事件記錄檔查詢清單。 string[]

WindowsFirewallLogsDataSource

名稱 描述
NAME 數據源的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有數據源 (都應該是唯一的。
字串
資料流 防火牆記錄數據流 string[] (必要)

DataCollectionRuleDestinations

名稱 描述
azureMonitorMetrics Azure 監視器計量目的地。 DestinationsSpecAzureMonitorMetrics
eventHubs 事件中樞目的地的清單。 EventHubDestination[]
eventHubsDirect 事件中樞直接目的地的清單。 EventHubDirectDestination[]
logAnalytics Log Analytics 目的地的清單。 LogAnalyticsDestination[]
monitoringAccounts 監視帳戶目的地的清單。 MonitoringAccountDestination[]
storageAccounts 記憶體帳戶目的地的清單。 StorageBlobDestination[]
storageBlobsDirect 記憶體 Blob 直接目的地的清單。 僅用於直接從代理程式傳送數據以儲存數據。 StorageBlobDestination[]
storageTablesDirect 記憶體數據表直接目的地的清單。 StorageTableDestination[]

DestinationsSpecAzureMonitorMetrics

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

EventHubDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

EventHubDirectDestination

名稱 描述
eventHubResourceId 事件中樞的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

LogAnalyticsDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串
workspaceResourceId Log Analytics 工作區的資源標識碼。 字串

MonitoringAccountDestination

名稱 描述
accountResourceId 監視帳戶的資源標識碼。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串

StorageBlobDestination

名稱 描述
containerName 記憶體 Blob 的容器名稱。 字串
NAME 目的地的易記名稱。
不論數據收集規則中的類型) 為何,此名稱在所有目的地 (都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串

StorageTableDestination

名稱 描述
NAME 目的地的易記名稱。
不論數據收集規則中) 類型為何,所有目的地 (此名稱都應該是唯一的。
字串
storageAccountResourceId 儲存體帳戶的資源識別碼。 字串
tableName 記憶體數據表的名稱。 字串