# Datadog Setup

This topic describes how to set up P0's integration for Datadog Logs. It has the following sections:

* [Prerequisites](#prerequisites)
* [Setup Datadog logs intake](#setup-datadog-logs-intake)
* [Configure Datadog logs intake](#configure-datadog-logs-intake)

### Prerequisites

* Existing P0 account at [p0.app](https://p0.app/)
* Datadog account with permissions to create API keys
* Datadog Logs intake URL for your region

### Setup Datadog logs intake

{% hint style="info" %}
This setup takes about 5 minutes.
{% endhint %}

1. Log in to [p0.app](https://p0.app) and select **Integrations**.
2. Under **Security Information & Event Managers**, select **Datadog**.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-50dea95734e9373ca2278500717a048008380856%2Flogsintake.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Click on **Logs intake** component.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-6d668dbd62e2990a7c15abbc2beacaa9d4337195%2Flogsapikey.png?alt=media" alt=""><figcaption></figcaption></figure>

4. Select **Add apiKey**.

<figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-f3b412c9319c070c68dbe7fa3dca3710796bedba%2Faddapikey.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Enter a unique custom identifier and click **Next**.
6. Enter the desired configuration and click **Finish** to complete the installation. See the [configuration section](#configure-datadog-logs-intake) for information about the settings.

### Configure Datadog logs intake

#### Intake URL

The Datadog Logs intake URL varies by region. Use the appropriate URL for your Datadog site:

| Datadog Site | Intake URL                                   |
| ------------ | -------------------------------------------- |
| US1          | `https://http-intake.logs.datadoghq.com`     |
| US3          | `https://http-intake.logs.us3.datadoghq.com` |
| US5          | `https://http-intake.logs.us5.datadoghq.com` |
| EU           | `https://http-intake.logs.datadoghq.eu`      |
| AP1          | `https://http-intake.logs.ap1.datadoghq.com` |

{% hint style="info" %}
Refer to the [Datadog documentation](https://docs.datadoghq.com/getting_started/site/) to find your Datadog site.
{% endhint %}

#### API key

You must provide a Datadog API key to authenticate log submissions. To create an API key:

1. In Datadog, navigate to **Organization Settings** > **API Keys**.
2. Click **New Key**.
3. Enter a name for the key (for example, "P0 Security").
4. Copy the key value and paste it into the P0 configuration.

{% hint style="info" %}
Refer to the official Datadog documentation for detailed instructions: [API and Application Keys](https://docs.datadoghq.com/account_management/api-app-keys/).
{% endhint %}

#### Service

Optional service name for log attribution. If not specified, defaults to `p0`. This value appears in the `service` field of your Datadog logs, allowing you to filter P0 audit logs.

{% hint style="success" %}
Congratulations! You are now set up with Datadog audit logs integration.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.p0.dev/integrations/siem-integrations/datadog-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
