> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/integrations/siem-integrations/splunk-hec-setup.md).

# Splunk HEC setup

Send P0 audit logs to a Splunk instance through the HTTP Event Collector (HEC).

P0 integrates with Splunk HEC (HTTP Event Collector) to forward audit logs from your P0 tenant to your Splunk instance.

## Prerequisites

* Existing P0 account at [p0.app](https://p0.app/)
* Splunk Instance Admin Role
* Public-facing Splunk instance with an HTTPS HEC endpoint.
  * The endpoint's SSL certificate must be signed by a trusted Certificate Authority (CA). P0 rejects self-signed certificates, including the default certificate on Splunk trial instances.
* Splunk HEC Token

## Set up Splunk HEC token

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

1. Log in to [p0.app](https://p0.app) and select **Integrations**. Under **Security Information & Event Managers**, select **Splunk**, then select the **HTTP Event Collector** component:

   <figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-b659dd821c3aadc87996c323e2579420c6dbb419%2FScreenshot%202025-01-24%20at%203.18.10%E2%80%AFPM%20(1).png?alt=media" alt="P0 Integrations page with Splunk selected, showing the HTTP Event Collector component"><figcaption></figcaption></figure>
2. Select **Add token**.

   <figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-86505f36fd6058134f763a2d95f5a7123db65cc3%2FScreenshot%202025-01-24%20at%203.21.07%E2%80%AFPM.png?alt=media&amp;token=21004d24-dc08-4101-a888-5158f8be1d30" alt="P0 Splunk HTTP Event Collector page showing the installed tokens table and the Add token button highlighted"><figcaption></figcaption></figure>
3. Enter a unique identifier for the token and select **Next**. The identifier can't contain a period (`.`).

   <div align="center" data-full-width="true"><figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-ca39e0edfab12ef90fd518763b6f2cab7df08597%2FScreenshot%202025-01-24%20at%203.24.19%E2%80%AFPM.png?alt=media&amp;token=c1fe6a5e-bb5e-4476-a299-2b8cbb1b61b9" alt="Splunk HEC token installation form with the token identifier input field highlighted" width="563"><figcaption></figcaption></figure></div>
4. Enter the settings described in [#configure-the-splunk-hec-token](#configure-the-splunk-hec-token "mention") and select **Finish**.

   <figure><img src="https://3783273641-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQNwGQz62W737pY0FzVb%2Fuploads%2Fgit-blob-4d98cb8dff291faffbee583e6db463cf95c471a3%2FScreenshot%202025-01-24%20at%203.25.25%E2%80%AFPM.png?alt=media&amp;token=ff7427da-ed8e-4d81-9268-cb8cbe91e461" alt="Splunk HEC configuration form with HEC endpoint and HEC token input fields and the Finish button"><figcaption></figcaption></figure>

When you select **Finish**, P0 sends a test event with the text `p0 integration test` to your HEC endpoint. The install completes only if Splunk accepts it. If Splunk rejects the token, P0 shows `Invalid HEC token`.

You can install one token. After you install it, P0 replaces the **Add token** button with `A maximum of 1 token may be installed`. To send logs to a different endpoint, delete the installed token and add a new one.

## Configure the Splunk HEC token

### HEC endpoint

The base HTTPS URL of your HEC input, with its port. Don't include a path: P0 adds `/services/collector/event` itself. You can find the port under **Global Settings** on the Splunk HEC settings page.

```
https://hec.example.com:8088
```

The endpoint must start with `https://`.

### HEC token

The token value Splunk shows when you create the HEC input. It is a GUID such as `12345678-1234-1234-1234-123456789012`.

{% hint style="info" %}
Refer to the official Splunk documentation for detailed instructions: [Set up HTTP Event Collector](https://docs.splunk.com/Documentation/Splunk/9.4.0/Data/UsetheHTTPEventCollector).
{% endhint %}

### Index

Optional. The Splunk index for P0's events. Leave it blank to use the token's default index. The index must be in the token's **Allowed Indexes** list.

## Find P0 events in Splunk

P0 sets these fields on every event it sends:

| Field        | Value                                                                                         |
| ------------ | --------------------------------------------------------------------------------------------- |
| `source`     | Your P0 tenant identifier, the `<your-org>` part of `https://p0.app/o/<your-org>`             |
| `sourcetype` | `p0:<type>`, where `<type>` is the event source, such as `p0:api` or `p0:permission-requests` |
| `host`       | The P0 API host                                                                               |

The event body follows the format in [Audit log format](https://docs.p0.dev/integrations/siem-integrations/audit-log-format.md). P0 moves the event's `type` field out of the body and into the `sourcetype` suffix. To search for all P0 events, run:

```
source="<your-org>" sourcetype="p0:*"
```

The install test event has `sourcetype` set to `p0:api`.
