For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/fr/api/latest/security-monitoring/update-a-dataset.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update a dataset

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
PATCHhttps://api.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.us3.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.us5.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.datadoghq.eu/api/v2/security_monitoring/datasets/{dataset_id}https://api.ap1.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.ap2.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.uk1.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.ddog-gov.com/api/v2/security_monitoring/datasets/{dataset_id}https://api.us2.ddog-gov.com/api/v2/security_monitoring/datasets/{dataset_id}

Présentation

Update an existing Cloud SIEM dataset. The current version of the dataset can be provided to detect concurrent modifications.

This endpoint requires any of the following permissions:

  • security_monitoring_rules_write
  • security_monitoring_dataset_write

OAuth apps require the security_monitoring_rules_write authorization scope to access this endpoint.

Arguments

Paramètres du chemin

Name
Type
Description
dataset_id [required]
string

The UUID of the dataset.

Requête

Body Data (required)

Champ
Type
Description
data [required]
object

The data wrapper of a dataset update request.

Réponse

No Content

Exemple de code

Update a dataset
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF
# Path parameters
export dataset_id="123e4567-e89b-12d3-a456-426614174000"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/security_monitoring/datasets/${dataset_id}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "columns": [
          {
            "column": "message",
            "type": "string"
          }
        ],
        "data_source": "logs",
        "indexes": [
          "main"
        ],
        "name": "sample_dataset",
        "search": {
          "query": "*"
        }
      },
      "description": "An updated description for the dataset.",
      "version": 1
    },
    "type": "datasetUpdate"
  }
}
EOF