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: {
      {customized property}: {}
    }
  }
  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: {
            {customized property}: 'string'
          }
          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: {
      {customized property}: {
        columns: [
          {
            name: 'string'
            type: 'string'
          }
        ]
      }
    }
  }
}

屬性值

dataCollectionRules

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

DataCollectionRuleResourceIdentity

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

UserAssignedIdentities

名字 描述 價值
{自定義屬性} UserAssignedIdentity

UserAssignedIdentity

此物件不包含在部署期間設定的任何屬性。 所有屬性都是 ReadOnly。

DataCollectionRuleResourceProperties

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

數據流

名字 描述 價值
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 事件中樞取用者組名 字串
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
要從 EventHub 收集的數據流 字串

ExtensionDataSource

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

IisLogsDataSource

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

LogFilesDataSource

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

LogFilesDataSourceSettings

名字 描述 價值
發簡訊 文字設定 LogFileSettingsText

LogFileSettingsText

名字 描述 價值
recordStartTimestampFormat 其中一種支援的時間戳格式 'ISO 8601'
'M/D/YYYY HH: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' (必要)

PerfCounterDataSource

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

PlatformTelemetryDataSource

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

PrometheusForwarderDataSource

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

PrometheusForwarderDataSourceLabelIncludeFilter

名字 描述 價值
{自定義屬性} 字串

SyslogDataSource

名字 描述 價值
facilityNames 設施名稱的清單。 包含任何的字串數組:
'*'
'alert'
'audit'
'auth'
'authpriv'
'clock'
'cron'
'精靈'
'ftp'
'kern'
'local0'
'local1'
'local2'
'local3'
'local4'
'local5'
'local6'
'local7'
'lpr'
'mail'
'mark'
新聞'
'nopri'
'ntp'
'syslog'
'user'
'uucp'
logLevels 要收集的記錄層級。 包含任何的字串數組:
'*'
'Alert'
'Critical'
'Debug'
'緊急'
'Error'
'Info'
'Notice'
'Warning'
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
此數據源將傳送至的數據流清單。
數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。
包含任何的字串數組:
'Microsoft-Syslog'

WindowsEventLogDataSource

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

WindowsFirewallLogsDataSource

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

DataCollectionRuleDestinations

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

DestinationsSpecAzureMonitorMetrics

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

EventHubDestination

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

EventHubDirectDestination

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

LogAnalyticsDestination

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

MonitoringAccountDestination

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

StorageBlobDestination

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

StorageTableDestination

名字 描述 價值
名字 目的地的易記名稱。
此名稱在數據收集規則內的所有目的地中都應該是唯一的。不論類型為何。
字串
storageAccountResourceId 記憶體帳戶的資源標識碼。 字串
tableName 記憶體數據表的名稱。 字串

DataCollectionRuleStreamDeclarations

名字 描述 價值
{自定義屬性} StreamDeclaration

StreamDeclaration

名字 描述 價值
此資料流中資料所使用的數據列清單。 ColumnDefinition[]

ColumnDefinition

名字 描述 價值
名字 數據行的名稱。 字串
類型 數據行數據的型別。 'boolean'
'datetime'
'dynamic'
'int'
'long'
'real'
'string'

快速入門範本

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

範本 描述
部署深色追蹤自動調整 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": {
      "{customized property}": {}
    }
  },
  "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": {
            "{customized property}": "string"
          },
          "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": {
      "{customized property}": {
        "columns": [
          {
            "name": "string",
            "type": "string"
          }
        ]
      }
    }
  }
}

屬性值

dataCollectionRules

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

DataCollectionRuleResourceIdentity

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

UserAssignedIdentities

名字 描述 價值
{自定義屬性} UserAssignedIdentity

UserAssignedIdentity

此物件不包含在部署期間設定的任何屬性。 所有屬性都是 ReadOnly。

DataCollectionRuleResourceProperties

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

數據流

名字 描述 價值
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 事件中樞取用者組名 字串
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
要從 EventHub 收集的數據流 字串

ExtensionDataSource

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

IisLogsDataSource

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

LogFilesDataSource

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

LogFilesDataSourceSettings

名字 描述 價值
發簡訊 文字設定 LogFileSettingsText

LogFileSettingsText

名字 描述 價值
recordStartTimestampFormat 其中一種支援的時間戳格式 'ISO 8601'
'M/D/YYYY HH: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' (必要)

PerfCounterDataSource

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

PlatformTelemetryDataSource

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

PrometheusForwarderDataSource

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

PrometheusForwarderDataSourceLabelIncludeFilter

名字 描述 價值
{自定義屬性} 字串

SyslogDataSource

名字 描述 價值
facilityNames 設施名稱的清單。 包含任何的字串數組:
'*'
'alert'
'audit'
'auth'
'authpriv'
'clock'
'cron'
'精靈'
'ftp'
'kern'
'local0'
'local1'
'local2'
'local3'
'local4'
'local5'
'local6'
'local7'
'lpr'
'mail'
'mark'
新聞'
'nopri'
'ntp'
'syslog'
'user'
'uucp'
logLevels 要收集的記錄層級。 包含任何的字串數組:
'*'
'Alert'
'Critical'
'Debug'
'緊急'
'Error'
'Info'
'Notice'
'Warning'
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
此數據源將傳送至的數據流清單。
數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。
包含任何的字串數組:
'Microsoft-Syslog'

WindowsEventLogDataSource

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

WindowsFirewallLogsDataSource

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

DataCollectionRuleDestinations

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

DestinationsSpecAzureMonitorMetrics

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

EventHubDestination

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

EventHubDirectDestination

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

LogAnalyticsDestination

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

MonitoringAccountDestination

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

StorageBlobDestination

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

StorageTableDestination

名字 描述 價值
名字 目的地的易記名稱。
此名稱在數據收集規則內的所有目的地中都應該是唯一的。不論類型為何。
字串
storageAccountResourceId 記憶體帳戶的資源標識碼。 字串
tableName 記憶體數據表的名稱。 字串

DataCollectionRuleStreamDeclarations

名字 描述 價值
{自定義屬性} StreamDeclaration

StreamDeclaration

名字 描述 價值
此資料流中資料所使用的數據列清單。 ColumnDefinition[]

ColumnDefinition

名字 描述 價值
名字 數據行的名稱。 字串
類型 數據行數據的型別。 'boolean'
'datetime'
'dynamic'
'int'
'long'
'real'
'string'

快速入門範本

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

範本 描述
部署深色追蹤自動調整 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 = {
              {customized property} = "string"
            }
            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 = {
        {customized property} = {
          columns = [
            {
              name = "string"
              type = "string"
            }
          ]
        }
      }
    }
    kind = "string"
  })
}

屬性值

dataCollectionRules

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

DataCollectionRuleResourceIdentity

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

UserAssignedIdentities

名字 描述 價值
{自定義屬性} UserAssignedIdentity

UserAssignedIdentity

此物件不包含在部署期間設定的任何屬性。 所有屬性都是 ReadOnly。

DataCollectionRuleResourceProperties

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

數據流

名字 描述 價值
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 事件中樞取用者組名 字串
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
要從 EventHub 收集的數據流 字串

ExtensionDataSource

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

IisLogsDataSource

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

LogFilesDataSource

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

LogFilesDataSourceSettings

名字 描述 價值
發簡訊 文字設定 LogFileSettingsText

LogFileSettingsText

名字 描述 價值
recordStartTimestampFormat 其中一種支援的時間戳格式 “ISO 8601”
“M/D/YYYY HH: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” (必要)

PerfCounterDataSource

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

PlatformTelemetryDataSource

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

PrometheusForwarderDataSource

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

PrometheusForwarderDataSourceLabelIncludeFilter

名字 描述 價值
{自定義屬性} 字串

SyslogDataSource

名字 描述 價值
facilityNames 設施名稱的清單。 包含任何的字串數組:
"*"
“alert”
“audit”
“auth”
“authpriv”
“clock”
“cron”
“精靈”
“ftp”
“kern”
“local0”
“local1”
“local2”
“local3”
“local4”
“local5”
“local6”
“local7”
“lpr”
“mail”
“mark”
“新聞”
“nopri”
“ntp”
“syslog”
“user”
“uucp”
logLevels 要收集的記錄層級。 包含任何的字串數組:
"*"
“Alert”
“Critical”
“Debug”
“緊急”
“Error”
“Info”
“注意”
“Warning”
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
此數據源將傳送至的數據流清單。
數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。
包含任何的字串數組:
“Microsoft-Syslog”

WindowsEventLogDataSource

名字 描述 價值
名字 數據源的易記名稱。
此名稱在數據收集規則內的所有數據源中都應該是唯一的。不論類型為何。
字串
此數據源將傳送至的數據流清單。
數據流會指出將針對此數據使用哪些架構,而且通常會在Log Analytics中將數據傳送至哪個數據表。
包含任何的字串數組:
“Microsoft-Event”
“Microsoft-WindowsEvent”
xPathQueries XPATH 格式的 Windows 事件記錄檔查詢清單。 string[]

WindowsFirewallLogsDataSource

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

DataCollectionRuleDestinations

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

DestinationsSpecAzureMonitorMetrics

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

EventHubDestination

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

EventHubDirectDestination

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

LogAnalyticsDestination

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

MonitoringAccountDestination

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

StorageBlobDestination

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

StorageTableDestination

名字 描述 價值
名字 目的地的易記名稱。
此名稱在數據收集規則內的所有目的地中都應該是唯一的。不論類型為何。
字串
storageAccountResourceId 記憶體帳戶的資源標識碼。 字串
tableName 記憶體數據表的名稱。 字串

DataCollectionRuleStreamDeclarations

名字 描述 價值
{自定義屬性} StreamDeclaration

StreamDeclaration

名字 描述 價值
此資料流中資料所使用的數據列清單。 ColumnDefinition[]

ColumnDefinition

名字 描述 價值
名字 數據行的名稱。 字串
類型 數據行數據的型別。 “boolean”
“datetime”
“dynamic”
“int”
“long”
“real”
“string”