What is the difference between stats and eventstats? [Intermediate]
Answer
stats transforms events into aggregate results, while eventstats computes aggregates and adds them back to each original event. Use stats when you only need the summary; use eventstats when you still need event-level detail plus the aggregate context.
Technical explanation
stats reduces the result set and removes fields not in the aggregation.
eventstats preserves original events and appends aggregate values such as average latency by service.
eventstats can be more expensive because it keeps many events in the pipeline.
Hands-on example
Example: index=prod_app service=checkout | eventstats avg(duration_ms) as avg_ms by endpoint | where duration_ms > 2*avg_ms. This keeps each slow event while comparing it to its endpoint's average. With stats alone, the raw events would be gone.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- What is a Splunk source, sourcetype, and host? [Intermediate]
- What is the difference between a universal and a heavy forwarder? [Intermediate]
- How do you build a Splunk dashboard, and when is it better than Grafana? [Advanced]
- What is the difference between a Splunk forwarder, indexer, and search head? [Intermediate]
- What is data retention and a bucket lifecycle (hot, warm, cold, frozen) in Splunk? [Advanced]
- How do you correlate logs and metrics during an incident? [Advanced]
- What is the Splunk data pipeline (input, parsing, indexing, search)? [Intermediate]
- What is Wavefront (Tanzu Observability), and what is it used for? [Advanced]