For the complete documentation index, see llms.txt. This page is also available as Markdown.

Splunk Integration Guide

Send alerts through webhooks.

Configure Splunk alerts to send webhook notifications to Harness AI SRE when searches detect issues.

Before you begin

  • Harness webhook endpoint: Create a webhook in Harness AI SRE. Go to Create a Webhook to set up the custom webhook configuration that Splunk uses.

  • Splunk permissions: Access to create and modify alerts and webhook alert actions.

  • Webhook URL: Copy the webhook URL from your Harness webhook configuration.

  • Splunk webhook documentation: Go to Use a Webhook Alert Action to understand webhook alert action configuration.


Create webhook alert action

  1. Navigate to Settings, then select Alert Actions.

  2. Click Create New Alert Action.

  3. Select Webhook.

Splunk Cloud requires using the Webhook Alert Action app or configuring via REST API.

  1. Install the Webhook Alert Action app from Splunkbase.

  2. Navigate to Apps, select Webhook Alert Action, then select Configuration.

Configure webhook alert action

Configure this field:

  • URL: Your Harness webhook URL.

    https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>

The webhook alert action does not expose fields for custom headers, authentication, HTTP method, or content type. Add the target URL to Splunk's webhook allow list if required by your Splunk deployment.


Webhook payload format

The webhook alert action sends a fixed JSON payload. Splunk does not support token substitution, custom templates, or configurable headers for this alert action; the payload structure below is always sent as-is.

  • result: The first result row of the triggered search, with keys matching the fields in your search results.

  • sid: The search ID (SID) of the triggered saved search.

  • results_link: A URL to the search results in Splunk.

  • search_name: The name of the saved search, or null if the search was not saved.

  • owner: The owner of the saved search.

  • app: The Splunk app context the search ran in.


Configure Splunk alert

Save a search as an alert in Splunk:

  1. Run your search query in Splunk.

  2. Click Save As, then select Alert.

Configure alert settings

Alert Type: Real-time

Trigger Condition: Per-result (trigger for each result)

Throttle: 5 minutes

Use case: Immediate response to critical events

Alert Type: Scheduled

Cron Expression: 0 * * * * (hourly)

Trigger Condition: Number of results > 0

Use case: Periodic summary reports or batch analysis

Add webhook trigger action

Attach the webhook action to the alert:

  1. In Trigger Actions, select Add Actions, then select Webhook.

  2. Select the webhook alert action you created for Harness AI SRE.

  3. Configure action-specific parameters.

Save the alert

Click Save to create the alert.


Configure field mapping in Harness

In your Harness webhook configuration, map the fixed Splunk payload fields (result, sid, results_link, search_name, owner, app) to alert properties.

Map basic fields

Use Mustache templates for simple field mapping:

Advanced field mapping with CEL

Use CEL for conditional logic and data transformation:

Because the payload does not include a severity or trigger-time field, derive severity and timing in Harness from the result object's fields (which mirror your search's output columns) or set a static severity for the webhook.


Test the integration

Test from Splunk

Trigger the saved search to confirm delivery:

  1. Open the saved search configured with the webhook.

  2. Click Run.

  3. Wait for the alert to trigger, or manually trigger it if conditions are met.

Verify in Splunk

Confirm the webhook action executed:

  1. Navigate to Activity, then select Triggered Alerts.

  2. Find your alert and verify the webhook action executed successfully.

  3. Check for HTTP response code (200 = success).

Verify in Harness

Confirm the alert arrived and mapped correctly:

  1. Navigate to Alerts in Harness AI SRE.

  2. Check that the alert appears.

  3. Verify field mapping:

    • Alert title matches expected format.

    • Message includes search results.

    • Tags are populated correctly.

    • Link navigates to Splunk search results.


Webhook payload fields

The webhook alert action always sends these fields. There are no additional tokens available for this alert action:

Field
Description
Example

result

The first result row of the triggered search

{"host": "web-01", "count": "8"}

sid

Search job ID

scheduler_admin_search_W2_at_14232356_132

results_link

URL to the search results

https://splunk.example.com/app/search/@go?sid=...

search_name

Saved search name, or null if unsaved

Prod Errors Search

owner

Owner of the saved search

admin

app

Splunk app context

search


Advanced configuration

Throttle real-time alerts

For continuous monitoring without overwhelming Harness:

Splunk alert configuration:

Harness CEL filter:

Scheduled batch analysis

For periodic summary reports:

Splunk alert configuration:

Harness field mapping:

Parse structured search result fields

Because result contains only the first row of the triggered search, design your search to surface the fields you need in that row (for example with stats or head 1):

Splunk search:

Harness field mapping:

Route by app

Create separate Harness webhooks for different Splunk apps:

Application logs webhook:

Security logs webhook:


Troubleshooting

Splunk webhook alert action is not triggering for a Harness AI SRE integration

Verify the alert trigger condition is met in Activity, then Triggered Alerts, ensure the webhook action is selected in the alert's Trigger Actions, check the Splunk _internal index for webhook errors, and test the alert manually by clicking Run on the saved search.

Splunk webhook returns HTTP errors when sending to a Harness AI SRE webhook

Verify the webhook URL is correct with no typos in the webhook ID, confirm the payload is valid JSON, review the Splunk Alert Action History for error messages, ensure the Harness webhook is enabled, and test the webhook manually with curl.

Splunk payload field mapping is not matching correctly in Harness AI SRE

Ensure field names match the payload keys exactly (result, sid, results_link, search_name, owner, app) because they are case-sensitive, remember that fields inside result mirror your search's output columns, and review Harness webhook logs to see the actual received payload.

Large Splunk first-result values cause timeouts in a Harness AI SRE webhook

Narrow your Splunk search to return only the fields you need before the alert triggers, and increase the Harness webhook timeout if needed.

search_name is missing or null in the Splunk webhook payload sent to Harness AI SRE

search_name is null when the triggering search was not saved. Save the search as an alert before attaching the webhook trigger action, and handle null values for search_name in your Harness field mapping.


Example: complete integration

This example shows a production-ready Splunk-to-Harness integration for application error monitoring.

Schedule: Real-time, trigger per-result, throttle 5 minutes

Splunk webhook payload

Splunk sends the fixed payload shape for every trigger, with result reflecting the columns from the saved search above:

Map fields in the Harness webhook


Next steps

  • Go to Route Alerts to route and deduplicate Splunk alerts.

  • Go to Use CEL in Webhooks to add advanced filtering and transformation logic.

  • Go to AI Agent to enable automated log analysis and correlation.


Splunk official documentation

Last updated

Was this helpful?