Skip to main content

What is SPL (Splunk Search Processing Language)?

SPL is Splunk's query language: search commands chained with pipes to filter, enrich, and aggregate events in Splunk Enterprise and Splunk Cloud.

Glossary
Updated 1 min read

Definition

SPL

Also called Search Processing Language, Splunk Search Processing Language, Splunk query language

SPL (Search Processing Language) is Splunk's query language, made of search commands chained with pipes that retrieve events from indexes and then filter, transform, and aggregate them.

How it works

Splunk's documentation says SPL encompasses all the search commands and their functions, arguments, and clauses. Search commands tell Splunk what to do with the events retrieved from indexes: filter unwanted information, extract fields, evaluate new fields, calculate statistics, reorder results, or build a chart. A search starts by retrieving events, typically by index, source type, and keywords, and then pipes the results through commands such as where, eval, rex, stats, table, and sort. Splunk's Search Reference catalogs every command with syntax and examples, including a guide that maps SPL to SQL for people who know the latter.

Example

A search that counts failed Okta sign-ins per user and source IP, then keeps the noisiest pairs:

index=okta eventType="user.session.start" outcome.result="FAILURE"
| stats count by actor.alternateId, client.ipAddress
| where count > 20
| sort - count

Saved as a scheduled search with an alert action, the same query becomes a detection.

Performance is the main practical concern at scale. Splunk documents that tstats runs statistical queries on indexed fields in tsidx files, from indexed data or accelerated data models, and is faster than stats because it doesn't read raw events. Many production detections therefore run against accelerated data models with tstats, keeping raw-event searches with stats for investigation and ad hoc hunting. Filtering early, by index, source type, and time range, before any pipe, also keeps searches cheap.

Why it matters for a SOC

Splunk has been a default SIEM for many SOCs, so years of detections, dashboards, and analyst habits are written in SPL. That investment is also a constraint: SPL rules only run on Splunk, so leaving Splunk means translating them, which is a recurring theme in Splunk alternatives. Cotool's SIEM page contrasts rules written by hand in SPL, KQL, or another proprietary SIEM language with detections written in Python that agents write, test, and tune. Its migration path has teams bring their existing rules, which agents then tune.

Go deeper

Sources

  1. About the search language | Splunk Documentation · accessed November 16, 2026
  2. Welcome to the Search Reference | Splunk Enterprise · accessed November 16, 2026
  3. stats | Splunk Documentation · accessed November 16, 2026
  4. tstats | Splunk Documentation · accessed November 16, 2026
  5. AI-Native SIEM Built for Agents | Cotool · accessed November 16, 2026

Attackers are scaling with tokens

Cotool helps defenders operate at machine speed. See how security teams are scaling Detection & Response.

Book a demo