다음을 통해 공유


Log Analytics 작업 영역에서 보조 계획을 사용하여 테이블 설정

보조 테이블 계획을 사용하면 저렴한 비용으로 Log Analytics 작업 영역에서 데이터를 수집하고 보존할 수 있습니다.

보조 테이블 계획의 사용 및 이점 중 일부를 설명하는 동영상입니다.

Azure Monitor 로그는 현재 Azure Monitor 에이전트 또는 로그 수집 API를 사용하여 수집한 데이터를 보내는 DCR(데이터 수집 규칙) 기반 사용자 지정 테이블에 대한 보조 테이블 계획을 지원합니다.

이 문서에서는 Log Analytics 작업 영역에서 보조 계획을 사용하여 새 사용자 지정 테이블을 만들고 이 테이블로 데이터를 보내는 데이터 수집 규칙을 설정하는 방법을 설명합니다. 보조 계획 개념에 대한 자세한 내용은 Azure Monitor 로그 테이블 계획을 참조하세요.

필수 조건

사용자 지정 테이블을 만들고 로그 데이터를 수집하려면 다음이 필요합니다.

  • 최소한 기여자 권한이 있는 Log Analytics 작업 영역.
  • DCE(데이터 수집 엔드포인트).
  • 보조 계획을 사용하여 테이블을 설정하는 것은 새 테이블에서만 지원됩니다. 보조 계획을 사용하여 테이블을 만든 후에는 테이블 계획을 전환할 수 없습니다.

비고

보조 로그는 모든 퍼블릭 클라우드 지역에 대해 일반 공급(GA)되지만 Azure Government 또는 중국 클라우드에서는 사용할 수 없습니다.

보조 계획으로 사용자 지정 테이블 만들기

사용자 지정 테이블을 만들려면 다음 명령을 사용하여 테이블 - Create API 를 호출합니다.

PUT https://management.azure.com/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.OperationalInsights/workspaces/{workspace_name}/tables/{table name_CL}?api-version=2023-01-01-preview

비고

현재 API 버전 2023-01-01-preview에서만 보조 테이블 계획을 설정할 수 있습니다.

이 페이로드를 요청 본문으로 제공합니다. 테이블 이름을 업데이트하고 테이블 스키마에 따라 열을 조정합니다. 이 샘플에서는 지원되는 모든 열 데이터 형식을 나열합니다.

 {
    "properties": {
        "schema": {
            "name": "table_name_CL",
            "columns": [
                {
                    "name": "TimeGenerated",
                    "type": "datetime"
                },
                {
                    "name": "StringProperty",
                    "type": "string"
                },
                {
                    "name": "IntProperty",
                    "type": "int"
                },
                 {
                    "name": "LongProperty",
                    "type": "long"
                },
                 {
                    "name": "RealProperty",
                    "type": "real"
                },
                 {
                    "name": "BooleanProperty",
                    "type": "boolean"
                },
                 {
                    "name": "GuidProperty",
                    "type": "guid"
                },
                 {
                    "name": "DateTimeProperty",
                    "type": "datetime"
                }
            ]
        },
        "totalRetentionInDays": 365,
        "plan": "Auxiliary"
    }
}

비고

  • 이 열은 TimeGenerated 정밀도(나노초)를 위한 소수 자릿수가 6개인 ISO 8601 형식만 지원합니다. 자세한 내용은 지원되는 ISO 8601 날짜/시간 형식을 참조하세요.
  • 보조 계획이 있는 테이블은 동적 데이터가 있는 열을 지원하지 않습니다.

보조 계획을 사용하여 테이블에 데이터 보내기

현재 보조 계획을 사용하여 사용자 지정 테이블에 데이터를 수집하는 방법에는 두 가지가 있습니다.

  • Azure Monitor 에이전트를 사용하여 텍스트 파일에서 로그 수집 / Azure Monitor 에이전트를 사용하여 JSON 파일에서 로그 수집.

    이 방법을 사용하는 경우 사용자 지정 테이블에는 두 개의 열(TimeGeneratedRawData(string 형식))만 있어야 합니다. 데이터 수집 규칙은 수집한 각 로그 항목 전체를 RawData 열로 보내고, Azure Monitor 로그는 로그가 수집된 시간으로 TimeGenerated 열을 자동으로 채웁니다.

  • Logs 수집 API를 사용하여 Azure Monitor에 데이터를 보냅니다.

    이 방법을 사용하려면:

    1. 이 문서에 설명된 대로 보조 계획을 사용하여 사용자 지정 테이블을 만듭니다.

    2. 자습서: 로그 수집 API를 사용하여 Azure Monitor에 데이터 보내기에 설명된 단계를 수행하여 다음을 수행합니다.

      1. Microsoft Entra 애플리케이션을 만듭니다.

      2. 이 ARM 템플릿을 사용하여 데이터 수집 규칙을 만듭니다.

      {
          "$schema": "https://schema.management.azure.com/schemas/2019-08-01/deploymentTemplate.json#",
          "contentVersion": "1.0.0.0",
          "parameters": {
              "dataCollectionRuleName": {
                  "type": "string",
                  "metadata": {
                      "description": "Specifies the name of the data collection rule to create."
                  }
              },
              "___location": {
                  "type": "string",
                  "metadata": {
                      "description": "Specifies the region in which to create the data collection rule. The must be the same region as the destination Log Analytics workspace."
                  }
              },
              "workspaceResourceId": {
                  "type": "string",
                  "metadata": {
                      "description": "The Azure resource ID of the Log Analytics workspace in which you created a custom table with the Auxiliary plan."
                  }
              }
          },
          "resources": [
              {
                  "type": "Microsoft.Insights/dataCollectionRules",
                  "name": "[parameters('dataCollectionRuleName')]",
                  "___location": "[parameters('___location')]",
                  "apiVersion": "2023-03-11",
                  "kind": "Direct",
                  "properties": {
                      "streamDeclarations": {
                          "Custom-table_name_CL": {
                              "columns": [
                                  {
                                      "name": "TimeGenerated",
                                      "type": "datetime"
                                  },
                                  {
                                      "name": "StringProperty",
                                      "type": "string"
                                  },
                                  {
                                      "name": "IntProperty",
                                      "type": "int"
                                  },
                                  {
                                      "name": "LongProperty",
                                      "type": "long"
                                  },
                                  {
                                      "name": "RealProperty",
                                      "type": "real"
                                  },
                                  {
                                      "name": "BooleanProperty",
                                      "type": "boolean"
                                  },
                                  {
                                      "name": "GuidProperty",
                                      "type": "guid"
                                  },
                                  {
                                      "name": "DateTimeProperty",
                                      "type": "datetime"
                                  }
                                      ]
                                      }
                                  },
                      "destinations": {
                          "logAnalytics": [
                              {
                                  "workspaceResourceId": "[parameters('workspaceResourceId')]",
                                  "name": "myworkspace"
                              }
                          ]
                      },
                      "dataFlows": [
                          {
                              "streams": [
                                  "Custom-table_name_CL"
                              ],
                              "destinations": [
                                  "myworkspace"
                              ]
                          }
                      ]
                  }
              }
          ],
          "outputs": {
              "dataCollectionRuleId": {
                  "type": "string",
                  "value": "[resourceId('Microsoft.Insights/dataCollectionRules', parameters('dataCollectionRuleName'))]"
              }
          }
      }
      

      위치:

    3. 애플리케이션에 DCR 사용 권한을 부여합니다.

다음 단계

자세히 알아보기: