---
name: iblai-connect-splunk
description: "Read and write Splunk data through the Splunk platform REST API and expose it to an ibl.ai agent as an MCP tool. Use when the user asks an agent to work with Splunk data, or to set up a Splunk MCP connection on ibl.ai."
metadata:
  kind: guide
---

# Splunk connector for AI agents

> A starting point maintained on ibl.ai at https://ibl.ai/developer/connectors/splunk — not part of the iblai/base repository. Checked against Splunk LLC (Cisco)'s documentation on October 20, 2026; test it against your own Splunk setup before you rely on it.

Splunk Enterprise and Splunk Cloud Platform index machine data and security logs and search them with SPL. A deployment holds indexes of events, saved searches and alerts, fired alerts, lookups and search job results.

## Auth & conventions

- **API:** Splunk platform REST API (REST). REST endpoints on the splunkd management port: create and manage search jobs, read events and results, manage saved searches and read fired alerts. /servicesNS/{user}/{app}/ sets the user and app context; v1 search endpoints are off by default, use v2.
- **Base URL:** https://{host}:8089/services/ (Splunk Cloud: https://{deployment-name}.splunkcloud.com:8089)
- **Access:** Issued by your administrator. Credentials come from the customer's own deployment. On Splunk Cloud Platform, port 8089 must be opened (ACS IP allow list or a support case), only the search tier is reachable, and free trial accounts cannot use the REST API.
- **Auth:** Authentication token (Authorization: Bearer); Session key from /services/auth/login; HTTP basic authentication. Tokens (7.3 and later) need token authentication enabled on the instance and work with native, LDAP or SAML users. A session key from /services/auth/login is sent as Authorization: Splunk {key}; sessions time out after one hour by default.
- **Limits:** List endpoints return 30 items by default (count, offset). Authenticated sessions time out after one hour by default. Splunk Cloud reaches the search tier only; deployment, clustering and restart operations are restricted.
- Keep Splunk credentials in environment variables or the ibl.ai credential store. Never print a token in chat and never commit one to a file.
- Destructive or outward-facing calls are marked **Confirm with the user first** — do.

## Reads

- **Search jobs and results** — POST search/v2/jobs/export or a search job, then read search/v2/jobs/{search_id}/results or /events while it runs.
- **Saved searches** — GET /services/saved/searches and saved/searches/{name}, including schedule and history.
- **Fired alerts** — GET /services/alerts/fired_alerts and alerts/fired_alerts/{name} for triggered alert instances.
- **Search job list** — GET /services/search/jobs lists current jobs and their search IDs.

## Writes

- **Run a search** — Create a search job or dispatch a saved search via saved/searches/{name}/dispatch.
- **Create or edit saved searches** — POST /services/saved/searches to create one; POST to saved/searches/{name} to update it.
- **Delete a saved search** — DELETE /services/saved/searches/{name} removes the saved search. **Confirm with the user first.**
- **Delete a fired alert** — DELETE alerts/fired_alerts/{name} deletes the record of a triggered alert. **Confirm with the user first.**

## Expose it to an ibl.ai agent (MCP)

Splunk LLC (Cisco) publishes an official MCP server, Splunk MCP Server (Splunkbase app 7931) (https://help.splunk.com/en/splunk-enterprise/mcp-server-for-splunk-platform/1.1/about-mcp-server-for-splunk-platform). Register it below as-is, or host your own server that wraps the calls in this skill.

First install the ibl.ai platform skills and connect your organization (writes `IBLAI_ORG`, `IBLAI_USERNAME` and `IBLAI_API_KEY` to `.env`):

```bash
npx skills add iblai/base --all
# then, in your coding agent:
/iblai-api-login
```

Every call below sends `Authorization: Api-Token $IBLAI_API_KEY`.

1. **Register the server** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-servers/` with `name`, `url`, `transport` (`sse` | `websocket` | `streamable_http`) and `auth_type` (`none` | `token` | `oauth2`). Capture the returned `id`.
   - For an API key or service credential use `auth_type=token` with `auth_scope=platform` for one key across the organization, or scope it to a single agent for one key per agent.
2. **Create the connection** — `POST https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mcp-server-connections/` with `server`, `scope` (`platform` | `mentor` | `user`), `auth_type`, and either `credentials` + `authorization_scheme` or a `connected_service` id for OAuth. Credentials are masked on read; never send a masked value back.
3. **Enable it on the agent** — `GET https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/{agent_id}/settings/`, add `mcp-tool` to `tool_slugs` and the server id to `mcp_servers`, then `PATCH` the full lists back. They are replaced, not merged.

Full reference: https://ibl.ai/developer/platform/mcp/mcp-connections and the `/iblai-api-agent-mcp` skill.

## Example prompts

- "Summarize failed logins by user and source IP in the last 24 hours"
- "Which saved searches fired alerts overnight, and how many times each?"
- "Enrich IP 203.0.113.7 with every firewall and proxy event from this week"
- "Draft a daily SOC report from the notable alerts of the last shift"

## Guardrails

- Security logs and alerts reveal an organization's systems, users and weaknesses. Grant least-privilege roles and keep every agent query in Splunk's audit trail.
- Request the narrowest Splunk scopes or role the task needs, and prefer a read-only credential for agents that only answer questions.
- Return the fields the user asked for, not whole records; do not paste personal data into chat that the user did not request.
- Before any write, show the user exactly what will change and wait for a yes.
- Respect the documented limits above: page through results and back off on rate-limit responses instead of retrying in a loop.

## References

- REST API user manual: basic concepts: https://help.splunk.com/en/splunk-enterprise/leverage-rest-apis/rest-api-user-manual/10.6
- Search endpoints reference: https://help.splunk.com/en/splunk-enterprise/leverage-rest-apis/rest-api-reference/10.2/search-endpoints
- About MCP Server for Splunk platform: https://help.splunk.com/en/splunk-enterprise/mcp-server-for-splunk-platform/1.1/about-mcp-server-for-splunk-platform
- Splunk MCP Server (Splunkbase app 7931): https://help.splunk.com/en/splunk-enterprise/mcp-server-for-splunk-platform/1.1/about-mcp-server-for-splunk-platform
- This connector on ibl.ai: https://ibl.ai/developer/connectors/splunk
- ibl.ai MCP server connections: https://ibl.ai/developer/platform/mcp/mcp-connections
