Indexed fields with tstats versus search-time extraction for high-volume Splunk searches
0 reputation · 09 Jun 2021, 18:42 UTC
0 reputation · 09 Jun 2021, 18:42 UTC
In Splunk Enterprise, a high-volume search over large event volumes can be classified as scan-bound using the Search Job Inspector, which reports component-level execution costs and statistics such as scanCount. The unresolved decision is whether to extract the relevant fields at index time so tstats can query tsidx files directly, or to retain search-time extraction for schema flexibility.
Indexed fields accelerate tstats but enlarge the index and lock the schema; correcting a bad extraction later requires re-ingesting affected data. Search-time extraction remains correctable but forces every search to parse raw events. Data model acceleration sits between the two by building tsidx summaries in the background, adding indexer CPU and disk while limiting coverage to data that fits the model.
A single Job Inspector run reflects one execution under one load level, so caching, concurrency, and distributed deployments can shift results. The trade-off depends on how frequently the search runs versus how much data it scans, which varies by workload and is not resolved by the inspector alone.
What factors should determine the choice between indexed fields with tstats, search-time extraction, or data model acceleration for a scan-bound search? How can a bounded side-by-side comparison clarify whether the speed gain justifies the storage overhead and schema lock-in before any ingest-time change?
35275 reputation · 09 Jun 2021, 23:50 UTC
For a scan‑bound search, pick the approach that delivers the best trade‑off between search speed and maintenance cost. Indexed fields + tstats win when the query is run frequently and the indexable fields are stable; they reduce scanCount but lock the schema and enlarge tsidx storage. Search‑time extraction keeps the schema flexible and avoids extra storage, but every run must parse raw events, which is CPU‑heavy. Data‑model acceleration sits in between: it builds tsidx summaries only for the fields that fit the model, adding background CPU and disk usage but keeping a flexible schema for events that fall outside the model.
tstats can be worth the index cost. For ad‑hoc or infrequent searches, search‑time extraction may be cheaper.tsidx by 30–50 % per field. Verify the storage impact with indexer summary before committing.tstats on indexed fields may still be faster.Run the same query three times and capture the same metrics in the Search Job Inspector:
tstats count where index=web sourcetype=access_combined by status
search index=web sourcetype=access_combined | stats count by status
| datamodel WebAccess | search status=200 | stats count by status
For each run, note:
scanCountCompare the speed gain against the increase in tsidx storage. A common rule of thumb is to adopt indexed fields if the query is >50 % faster and the storage increase is ≤ 30 % of the current index size.
To refine the recommendation, we need the average number of events per search and the average event size. These figures influence whether the cost of re‑ingestion for indexed fields outweighs the scan savings.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.