Study guide

8.1 How Distributed Search Works

Splunk Enterprise Certified Admin SPLK-1003

Track your progress as you read

Finished sections get a check mark.

1 Introduction

About the Splunk Enterprise Certified Admin Exam

2 Chapter 1: Splunk Admin Basics

1.1 Splunk Enterprise Architecture & Core Components

3 Chapter 2: License Management

2.1 License Types, Stacks, Pools & Licensing Architecture 2.2 License Violations, Rolling Window Warnings & Troubleshooting

4 Chapter 3: Splunk Configuration Files

3.1 Splunk Configuration Directory Structure 3.2 Configuration Layering, Precedence & Resolution Rules 3.3 Using btool to Inspect & Debug Configurations

5 Chapter 4: Splunk Indexes

4.1 Index Structure: Directories, Buckets & Bucket Files 4.2 Bucket Types & the Hot-Warm-Cold-Frozen-Thawed Lifecycle 4.3 Checking Index Data Integrity 4.4 indexes.conf Options: Paths, Bucket Sizing & Volumes 4.5 The Fishbucket: File Tracking, CRC Collisions & Re-reading Files 4.6 Applying a Data Retention Policy

6 Chapter 5: Splunk User Management

5.1 Splunk Roles, Capabilities & Custom Role Design 5.2 User Account Administration, Search Restrictions & Limits

7 Chapter 6: Splunk Authentication Management

6.1 Integrating Splunk with LDAP 6.2 Other Authentication Options & Enabling Multifactor Authentication

8 Chapter 7: Getting Data In

7.1 CLI Administration & Basic Data Onboarding Workflows 7.2 Forwarder Types: Universal Forwarder vs. Heavy Forwarder

9 Chapter 8: Distributed Search

8.1 How Distributed Search Works 8.2 Roles of the Search Head and Search Peers 8.3 Configuring Search Peers & Distributed Search Groups 8.4 Search Head Scaling & Search Head Clustering (SHC)

10 Chapter 9: Getting Data In – Staging

9.1 Ingestion Pipeline Stages: Input, Parsing, Merging, Typing & Indexing 9.2 Pipeline Component Placement & Queue Management 9.3 Splunk Input Options

11 Chapter 10: Configuring Forwarders

10.1 Forwarder Setup & outputs.conf Load Balancing 10.2 Indexer Acknowledgment, Data Cloning & Forwarder Routing

12 Chapter 11: Forwarder Management

11.1 Deployment Management & the Deployment Server 11.2 Deployment Apps & Deployment Clients 11.3 Server Classes, Client Grouping & App Deployment Strategies 11.4 Forwarder Management Monitoring & Troubleshooting

13 Chapter 12: Monitor Inputs

12.1 File & Directory Monitoring Mechanics 12.2 Monitor Input Tuning: Whitelists, Blacklists & CRC Settings 12.3 Deploying a Remote Monitor Input, Network Shares & Archives

14 Chapter 13: Network and Scripted Inputs

13.1 Creating Network Inputs: TCP & UDP 13.2 Optional Settings for Network Inputs 13.3 Scripted Inputs & PowerShell Data Collection

15 Chapter 14: Agentless Inputs

14.1 Windows Management Instrumentation (WMI) Inputs 14.2 HTTP Event Collector (HEC) Architecture & Administration

16 Chapter 15: Fine Tuning Inputs

15.1 Input-Phase Processing & Default Metadata Assignment 15.2 Character Set Encoding & Handling Binary Data

17 Chapter 16: Parsing Phase and Data

16.1 Line Breaking & Event Segmentation 16.2 Timestamp Extraction, Time Zones & Clock Skew Handling 16.3 Validating Event Parsing with Data Preview

18 Chapter 17: Manipulating Raw Data

17.1 Transformation Mechanics: props.conf & transforms.conf 17.2 Data Masking, Redaction & SEDCMD 17.3 Event Routing, Dynamic Index Assignment & Filtering to nullQueue

8.1 How Distributed Search Works

Key Takeaways Explain This Topic AI

A distributed search splits into a remote search that runs in parallel on every search peer and a local search on the search head that merges the results.

Peers do the map phase: they scan their own buckets, apply distributable streaming commands such as eval, rex, where, and fields, and pre-aggregate transforming commands.

The search head does the reduce phase: it merges partial results, then runs centralized streaming commands (such as head and streamstats) and commands that need the whole result set, such as sort.

Transforming commands such as stats, chart, and timechart send compact partial aggregates across the network instead of raw events, which is why they scale well.

Search heads dispatch searches to peers over the management port (TCP 8089).

Last updated: September 2026

How Distributed Search Works

In standalone Splunk Enterprise deployments, a single instance performs ingestion, parsing, indexing, and search processing simultaneously. While manageable for small-scale operations or test environments, this monolithic architecture introduces severe resource contention as search concurrency and data ingestion volumes expand. To deliver enterprise-scale analytics, Splunk decouples data storage from search execution through Distributed Search .

Understanding distributed search mechanics—specifically how Search Heads communicate with Search Peers (Indexers), how queries decompose into parallelized tasks, and how search-time knowledge objects synchronize across nodes—is a cornerstone of enterprise administration.

The Distributed Query Execution Lifecycle

When a user or automated schedule executes a search query across a distributed environment, the search flows through six distinct execution phases spanning the Search Head and connected Search Peers: [1. SPL Compilation] --> Search Head parses SPL into Abstract Syntax Tree (AST)

  • |
  • [2. Pipeline Split] --> Splits query into Remote Search (Peers) and Local Search (SH)
  • |
  • [3. Dispatch & Sync] --> Validates knowledge bundle checksum; dispatches via REST (8089)
  • |
  • [4. Peer Map Phase] --> Peers scan local .tsidx, decompress rawdata, apply filters/eval
  • |
  • [5. Result Streaming] --> Peers stream intermediate result blocks back to SH over HTTPS
  • |
  • [6. SH Reduce Phase] --> Search Head merges, sorts, aggregates, and renders final table
  • Phase 1: Query Compilation and SPL Parsing

The user submits a query on the Search Head (e.g., index=web status=500 | eval endpoint=lower(uri) | stats count by endpoint | sort - count ). The Search Head parser validates syntax, checks user authorization in authorize.conf , and generates an Abstract Syntax Tree (AST).

Phase 2: Remote vs. Local Pipeline Decomposition

The Search Head breaks the query pipeline into two segments:

The Remote Search (dispatched to peers): The portion of the query that can run independently on the indexers. This includes the initial index retrieval ( index=web status=500 ), distributable streaming operations ( eval endpoint=lower(uri) ), and the pre-stats generation phase of the transforming command ( stats count by endpoint ).

The Local Search (retained on the Search Head): The portion that requires unified cross-indexer data, including the final merge of stats count by endpoint and the sorting operation ( sort - count ).

Phase 3: Knowledge Bundle Verification and Dispatch

The search head makes sure its peers have a current knowledge bundle. It replicates bundles in the background and when it starts a search, sending the full bundle the first time and deltas afterward. It then dispatches the remote part of the search to each peer over the management port (TCP 8089).

Phase 4: Local Index Scanning and Map Processing

Each search peer receives the remote search. The peer:

Identifies which local buckets overlap the query's time range ( earliest to latest ).

Scans the .tsidx files of matching buckets to identify specific record offsets matching the search terms ( index=web AND status=500 ), bypassing non-matching events entirely.

Fetches the compressed rawdata blocks from disk, decompresses them into memory, and extracts required fields.

Executes the distributable streaming operations in parallel across its local CPU cores.

Performs localized pre-aggregation (e.g., tallying partial counts for each unique endpoint ).

Phase 5: Streaming Intermediate Result Sets

The search peers package their partial results into compressed memory buffers and stream them back to the Search Head over the management connection.

Phase 6: Reduce Phase and Global Finalization

The Search Head collects the intermediate streams from all responding search peers. The local pipeline executes:

Merging identical keys across different peers (e.g., summing the counts of /login received from Indexer 1, Indexer 2, and Indexer 3).

Executing centralized streaming or post-transforming commands (such as sort - count , head 10 ).

Writing final results to the search dispatch directory ( $SPLUNK_HOME/var/run/splunk/dispatch/<sid>/ ) and rendering the output in Splunk Web.

SPL Command Classifications & Processing Topologies

How efficiently a query runs in a distributed environment depends on command placement. Splunk categorizes SPL commands into three distinct architectural classes based on whether they can be distributed to indexers or must execute on the Search Head. +-----------------------------------------------------------------------------------------+

  • | DISTRIBUTABLE STREAMING COMMANDS (Execute on Search Peers in Parallel) |
  • | eval, rex, lookup, fields, rename, where, replace |
  • | -> Evaluates each event independently; filters and enriches before network transmission. |
  • +-----------------------------------------------------------------------------------------+
  • |
  • v
  • +-----------------------------------------------------------------------------------------+
  • | TRANSFORMING COMMANDS (Map Phase on Search Peers, Reduce Phase on Search Head) |
  • | stats, chart, timechart, top, rare |
  • | -> Peers produce partial aggregates; Search Head merges partials into final statistics. |
  • +-----------------------------------------------------------------------------------------+
  • |
  • v
  • +-----------------------------------------------------------------------------------------+
  • | CENTRALIZED STREAMING COMMANDS (Must Execute Centrally on Search Head) |
  • | head, streamstats, some modes of dedup |
  • | -> Requires global cross-indexer event ordering; forces raw event streaming to the SH. |
  • +-----------------------------------------------------------------------------------------+
  • 1. Distributable Streaming Commands

A command is distributable streaming if it operates on each individual event in isolation, without requiring information about preceding or succeeding events. Because each record is self-contained, Splunk distributes these commands directly to the Search Peers.

Common Commands: eval , rex , lookup , fields , rename , where , replace .

Performance Impact: Highly efficient. Distributing these commands leverages the aggregate CPU power of the entire indexer tier. For example, filtering with where response_time > 5000 on the indexers prevents millions of non-matching raw events from ever traversing the network to the Search Head.

2. Centralized Streaming Commands

A command is centralized streaming if it operates on individual events one at a time, but requires a specific global ordering across the entire dataset. Because individual search peers only hold a subset of the data, they cannot determine global sequence.

Common Commands: head , streamstats , and some modes of dedup (Splunk's own examples). Commands such as sort , tail , and eventstats need the whole result set and also run on the search head.

Performance Impact: Heavy. Centralized streaming commands force the Search Head to perform the streaming operation locally. When streamstats is invoked without a prior transforming command, search peers must transmit raw, non-aggregated event streams to the Search Head, creating network traffic and concentrating CPU and RAM consumption on the Search Head.

3. Transforming and Non-Streaming Commands

Transforming commands convert raw event streams into structured statistical tables. They do not operate on continuous streams; instead, they aggregate data across the entire result set.

Common Commands: stats , chart , timechart , top , rare .

Performance Impact: Exceptional efficiency. Splunk splits transforming commands into a two-phase operation:

Pre-stats (Peers): Search peers compute partial aggregates (sums, counts, min/max) locally per group key.

Post-stats (Search Head): The Search Head receives compact statistical tuples rather than bulky raw events and sums the partial aggregates into final numbers.

SPL Command Execution Breakdown

Command Class Execution Placement Primary Examples Network & Resource Impact

Distributable Streaming Search Peers (parallel map) eval , rex , lookup , fields , rename , where Minimal network load; distributes processing across indexer cores.

Centralized Streaming Search Head (centralized) head , streamstats , some modes of dedup Higher network load; events travel to the search head before evaluation.

Transforming Two-phase (Peers map, SH reduce) stats , chart , timechart , top , rare Extremely low network load; transmits only compact statistical aggregates.

  • Walkthrough: End-to-End Query Decomposition
  • Consider this realistic administrative query: index=firewall action=blocked
  • | eval src_subnet = replace(src_ip, "\.\d+$", ".0/24")
  • | stats count by src_subnet
  • | sort - count
  • | head 10

Indexers (Search Peers):

Filter local buckets for index=firewall action=blocked using index-time .tsidx posting lists.

Execute eval src_subnet = ... on matching records.

Execute pre-stats: group records by src_subnet and calculate intermediate local counts.

Stream intermediate tuples (e.g., 192.168.1.0/24 -> 450 ) to the Search Head.

Search Head:

Gathers tuples from all indexers and merges identical src_subnet keys (e.g., adding 450 from Peer 1 and 300 from Peer 2).

Executes the non-streaming sort - count operation across the finalized table.

Applies the centralized streaming head 10 filter to restrict output to the top 10 rows.