> For the complete documentation index, see [llms.txt](https://herd-security.gitbook.io/herd-security-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://herd-security.gitbook.io/herd-security-docs/setup-and-integrations/settings/splunk.md). Agents can also search and read this documentation through its [MCP server](https://herd-security.gitbook.io/herd-security-docs/~gitbook/mcp).

# Connect Splunk

Let Herd pull security events from Splunk on a schedule and treat them as human-risk signals that can raise a person's risk score and assign training.

Herd can pull security events from your Splunk deployment and treat each one as a human-risk signal for the person it's about. An event can raise that person's risk score and assign them a corrective training, the same as an alert sent through the [SIEM / DLP webhook](https://herd-security.gitbook.io/herd-security-docs/setup-and-integrations/settings/siem-dlp-webhooks.md).

Use this when you would rather have Herd read from Splunk than set up Splunk to push to a webhook. You can run both.

***

## What you need

* A Splunk deployment whose management API (port 8089 by default) Herd can reach over HTTPS.
* A saved search, or an index, that holds the events you want Herd to act on.
* In Splunk, permission to create an authentication token.
* In Herd, the **integrations** permission.

***

## 1. Create a read-only token in Splunk

1. In Splunk, open **Settings > Tokens** and create a token for a user that can read only the saved search or index you will give Herd.
2. Copy the token when Splunk shows it.

Herd sends the token as a bearer token and only runs searches. It never writes to Splunk. Scope the token on the Splunk side to the saved search or index below, so it can't read anything else.

***

## 2. Connect in Herd

1. In **Settings → Integrations**, open **Splunk** (in the **Security & SIEM** section).
2. Fill in the form under **Splunk Configuration Settings**:
   * **Splunk Base URL**: your management API URL, including the port. For example, `https://splunk.your-company.com:8089`.
   * **Saved Search or Index**: what Herd reads. Use `savedsearch:My Notable Events` for a saved search, `index=security` for a search over an index, or a bare index name such as `security`. Point this at a read-only surface.
   * **Splunk API Token**: the token from step 1.
3. Select **Save Splunk Configuration**.

Herd stores the token encrypted and never shows it again. To change the search or index later, open the same settings and save without typing a token; Herd keeps the one it has. If you change the **Splunk Base URL**, Herd asks you to enter the token again, so a saved token can't be sent to a different address.

{% hint style="info" %}
The base URL must be an address Herd can reach from the internet. Addresses on private networks aren't allowed.
{% endhint %}

***

## 3. Decide which alerts count

Herd pulls every event your search returns and records the ones it can attach to a person. An event assigns training only when its alert type is mapped.

In **Settings → Integrations → SIEM & DLP Webhooks**, add an alert mapping for each alert you want to act on. The **Alert Type** is the value Herd reads from the event (see the field table below), and **Source** is `splunk`. See [Alert-to-training mappings](https://herd-security.gitbook.io/herd-security-docs/setup-and-integrations/settings/siem-dlp-webhooks.md#alert-to-training-mappings).

***

## What Herd reads from each event

Herd looks through these fields, in this order, and uses the first one that has a value.

| Herd needs       | Splunk fields checked                                                                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| The person       | `user_email`, `user`, `src_user`, `owner`, `recipient`, `src_user_name` (the value must look like an email address) |
| Alert type       | `rule_name`, `search_name`, `signature`, `eventtype`, `source`                                                      |
| Description      | `rule_description`, `description`, `rule_title`, `_raw`                                                             |
| Event ID         | `event_id`, `orig_event_id`, `_cd`                                                                                  |
| Severity         | `urgency`, then `severity`                                                                                          |
| When it happened | `_time`                                                                                                             |

Severity is read as `critical`, `high` or `medium`. Anything else, including `low`, `informational` and a missing value, counts as low. If an event has no alert type, Herd uses `siem_alert`. If it has no event ID, Herd builds a stable one from the event, so pulling the same event twice never counts it twice.

Herd keeps the fields of each event it ingests alongside the event.

***

## Who each event is about

Herd matches the email address it found to the person with that address in Herd. Herd skips an event when none of the person fields above holds an email address. It doesn't guess a person from a username or a host. Skipped events are counted in the sync result and not kept.

Make sure your search returns one of those fields as an email address. If your events carry a short username, add an `eval` to the saved search that builds the address.

***

## How often Herd pulls

Every two hours, Herd runs your search for the period since the last successful pull and handles the new events. Select **Sync now** on the card to pull straight away.

* The first pull reaches back 24 hours.
* Each pull reads at most 1,000 events. Keep the search narrow enough that a two-hour window stays under that.
* The card shows **Last successful pull** and the **Search / index** in use.

If Splunk refuses the token (a revoked token or missing permission), the card says so and Herd waits a week before trying again on its own. Fix the token in Splunk, save the new one if you made one, and select **Sync now**. Other errors, such as a network problem, are retried on the next two-hour pull.

***

## Where the events show up

Pulled events feed the person's risk score and show on the people page. Any event whose alert type matches a mapping also assigns the mapped training.

***

## Stop pulling

Select **Disconnect** on the card and confirm. Herd stops pulling events and deletes the stored API token. Events already pulled stay, along with the risk events and trainings they produced. To reconnect, enter a new API token and save; the first pull then starts fresh from the last 24 hours. You can also revoke the token in Splunk.
