SPLK-1002 Advanced Searching and Statistics Practice Question
An analyst wants to create a timechart of the count of events per hour, but only for events where the field `status` contains the word "fail" (case-insensitive). Which search is correct?
⚠ Common exam trap
Splunk often tests the distinction between `search` (which supports wildcards) and `where` (which does not), and the requirement to use `match` with regex flags for case-insensitive substring matching in aggregation commands.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
index=main | timechart count by eval(case(match(status,"(?i)fail"),1))
It uses `eval` with `case` and `match` to create a field that is 1 when `status` contains 'fail' (case-insensitive via `(?i)`), then uses `timechart count by` that field to count only matching events per hour. This approach correctly filters within the timechart aggregation, ensuring only events where status matches the pattern are counted.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
index=main | timechart count | search status=*fail*
Why it's wrong here
After timechart, the status field is no longer present.
- ✗
index=main | regex status="fail" | timechart count
Why it's wrong here
regex does not use glob matching; it expects regex pattern, so "fail" would match literal "fail" but not case-insensitive.
- ✗
index=main | where status="*fail*" | timechart count
Why it's wrong here
where uses case-sensitive and does not support wildcards; use like instead.
- ✓
index=main | timechart count by eval(case(match(status,"(?i)fail"),1))
Why this is correct
match with (?i) does case-insensitive regex and eval creates a field for timechart.
Go deeper
Related to this question
About these practice questions
Courseiva writes every SPLK-1002 question from scratch — 475 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SPLK-1002 practice question is part of Courseiva's free Splunk certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SPLK-1002 exam.