{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cockroach-labs/json-schema/cockroach-labs-enable-log-export-body-schema.json",
  "title": "EnableLogExportRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cockroach-labs-log-export-api-openapi.yml#/components/schemas/EnableLogExportBody",
  "type": "object",
  "properties": {
    "auth_principal": {
      "description": "auth_principal is used in different contexts based on integration.\nCloudWatch: AWS Role ARN that identifies a role\nthat the cluster account can assume to write to CloudWatch\nGCP Cloud Logging: GCP Project ID that the cluster service account\nhas permissions to write to for cloud logging.\nAzure Log Analytics (AZURE_LOG_ANALYTICS): CustomerID or WorkspaceID.\nRequired for AWS_CLOUDWATCH, GCP_CLOUD_LOGGING, and AZURE_LOG_ANALYTICS.\nNot used for AZURE_LOG_ANALYTICS_V2 or OTLP_HTTP. OTLP_HTTP authenticates\nvia otlp_headers (see otlp_endpoint / otlp_headers).",
      "type": "string"
    },
    "aws_external_id": {
      "description": "aws_external_id to include when assuming the IAM role specified by role_arn.\nOptional. A specific value may be required by the role's trust policy.\nOnly supported for Advanced clusters on AWS. If provided for a Standard cluster,\nthe request is rejected.",
      "type": "string"
    },
    "azure_client_id": {
      "description": "Azure client ID for the app registration used by the Logs Ingestion API.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_client_secret": {
      "description": "Azure client secret for the app registration used by the Logs Ingestion API.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_dce_endpoint": {
      "description": "Logs ingestion endpoint of the Azure Data Collection Endpoint (DCE). For\nexample, https://{dce-name}.{region}.ingest.monitor.azure.com.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_dcr_immutable_id": {
      "description": "Immutable ID of the Azure Data Collection Rule (DCR), for example dcr-...\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_dcr_resource_id": {
      "description": "Full ARM resource ID of the Azure Data Collection Rule (DCR). Cockroach\nCloud reads and updates this DCR to add streams for each configured log\ngroup. For example,\n/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.Insights/dataCollectionRules/{dcr-name}.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_shared_key": {
      "description": "The primary or the secondary connected sources client authentication key.\nThis is used to export logs to Azure Log Analytics via the legacy\nHTTP Data Collector API. Deprecated: use azure_client_secret instead.",
      "type": "string"
    },
    "azure_tenant_id": {
      "description": "Azure tenant ID for the app registration used by the Logs Ingestion API.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "azure_workspace_resource_id": {
      "description": "Full ARM resource ID of the Log Analytics workspace. Cockroach Cloud creates\nor updates the required custom tables for each configured log group. For\nexample, /subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.OperationalInsights/workspaces/{workspace-name}.\nRequired when type is AZURE_LOG_ANALYTICS_V2.",
      "type": "string"
    },
    "groups": {
      "description": "groups is a collection of log group configurations that allows the\ncustomer to define collections of CRDB log channels that are aggregated\nseparately at the target sink.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/LogExportGroup"
      }
    },
    "log_name": {
      "description": "log_name is an identifier for the logs in the customer's log sink. For\nAZURE_LOG_ANALYTICS_V2, it must start with a letter and contain only\nletters, digits, and underscores.",
      "type": "string"
    },
    "omitted_channels": {
      "description": "omitted_channels is a list of channels that the user does not want to\nexport logs for.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "otlp_endpoint": {
      "description": "otlp_endpoint is the OTLP/HTTP URL for the OTLP_HTTP sink type. Customers\nmay provide either a base endpoint or a full /v1/logs endpoint. Required\nwhen type is OTLP_HTTP.",
      "type": "string"
    },
    "otlp_headers": {
      "description": "otlp_headers are auth headers (name->value) for the OTLP_HTTP sink, e.g.\n{\"authorization\": \"Bearer ...\"}. Write-only: values are stored securely and\nnever returned. For existing OTLP_HTTP configurations, omitting this field\nor sending an empty map preserves the stored headers; sending a non-empty map\nreplaces them.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "redact": {
      "description": "redact allows the customer to set a default redaction policy for\nlogs before they are exported to the target sink. If a group config\nomits a redact flag and this one is set to `true`, then that group\nwill receive redacted logs.",
      "type": "boolean"
    },
    "region": {
      "description": "region allows the customer to override the destination region for\nall logs for a cluster.",
      "type": "string"
    },
    "type": {
      "$ref": "#/$defs/LogExportType"
    }
  },
  "required": [
    "type",
    "log_name"
  ],
  "$defs": {
    "LogExportGroup": {
      "description": "LogExportGroup contains an export configuration for a single\nlog group which can route logs for a subset of CRDB channels.",
      "type": "object",
      "properties": {
        "channels": {
          "description": "channels is a list of CRDB log channels to include in this\ngroup.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enable_sending_queue": {
          "description": "enable_sending_queue enables the sending queue for logs in this\ngroup. Only one group can have enable_sending_queue enabled.",
          "type": "boolean"
        },
        "log_name": {
          "description": "log_name is the name of the group, reflected in the log sink. For\nAZURE_LOG_ANALYTICS_V2, it must start with a letter and contain only\nletters, digits, and underscores.",
          "type": "string"
        },
        "min_level": {
          "$ref": "#/$defs/LogLevel.Type"
        },
        "redact": {
          "description": "redact is a boolean that governs whether this log group\nshould aggregate redacted logs. Redaction settings will\ninherit from the cluster log export defaults if unset.",
          "type": "boolean"
        }
      },
      "required": [
        "log_name",
        "channels"
      ]
    },
    "LogExportType": {
      "description": "LogExportType identifies the destination used for exported logs.\nCloud-native destinations use their provider's logging service, while\nOTLP_HTTP sends logs to a customer-configured OTLP/HTTP endpoint.\n\n - AZURE_LOG_ANALYTICS: AZURE_LOG_ANALYTICS is the legacy Azure export path via the HTTP Data\nCollector API (retiring 2026-09-14). Deprecated: use\nAZURE_LOG_ANALYTICS_V2 instead.\n - AZURE_LOG_ANALYTICS_V2: AZURE_LOG_ANALYTICS_V2 exports to Azure Monitor via the Logs Ingestion API\nand DCR-based ingestion, replacing the deprecated AZURE_LOG_ANALYTICS path\nthat uses the HTTP Data Collector API (retiring 2026-09-14). V2 authenticates\nwith a tenant/client/secret + DCR endpoint and rule, whereas the legacy type\nuses a workspace ID + shared key.",
      "type": "string",
      "enum": [
        "AWS_CLOUDWATCH",
        "GCP_CLOUD_LOGGING",
        "AZURE_LOG_ANALYTICS",
        "AZURE_LOG_ANALYTICS_V2",
        "OTLP_HTTP"
      ]
    },
    "LogLevel.Type": {
      "description": " - UNSPECIFIED: The unspecified log level includes all logs.\n - WARNING: The WARNING severity is used for situations which may require\nspecial handling, where normal operation is expected to resume\nautomatically.\n - ERROR: The ERROR severity is used for situations that require special\nhandling, where normal operation could not proceed as expected.\nOther operations can continue mostly unaffected.\n - FATAL: The FATAL severity is used for situations that require an\nimmediate, hard server shutdown. A report is also sent to\ntelemetry if telemetry is enabled.",
      "type": "string",
      "enum": [
        "UNSPECIFIED",
        "WARNING",
        "ERROR",
        "FATAL"
      ]
    }
  }
}