SPLK-1002 Advanced Searching and Statistics Practice Question
Exhibit
Refer to the exhibit. | inputlookup user_roles.csv | eval role=if(like(user, "admin%"), "admin", "user") | search role=admin | stats count by role
The search returns zero results, but the lookup file contains users with names like 'admin1', 'admin2'. What is the most likely reason?
⚠ Common exam trap
Splunk often tests the misconception that 'like' is case-insensitive or automatically handles spaces, leading candidates to overlook the need for explicit trimming or case normalization.
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
✓
The 'like' function requires a wildcard pattern with '%' but the field value may have leading/trailing spaces or the pattern is case-sensitive.
The 'like' function in Splunk uses SQL-style pattern matching where '%' matches any sequence of characters. If the lookup file contains 'admin1' and 'admin2', but the search uses 'like(role, "admin%")', leading/trailing spaces in the field values or case sensitivity (e.g., 'Admin1' vs 'admin1') would cause the pattern to fail, returning zero results. Option B correctly identifies this as the most likely reason because Splunk's 'like' is case-sensitive by default and does not trim spaces.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The lookup file is not in CSV format.
Why it's wrong here
If it were not CSV, inputlookup would error.
- ✓
The 'like' function requires a wildcard pattern with '%' but the field value may have leading/trailing spaces or the pattern is case-sensitive.
Why this is correct
like() is case-sensitive; also if user has spaces, pattern may not match.
- ✗
The stats command only counts events where role=admin, but the role field is already filtered.
Why it's wrong here
The search command already filters role=admin, so stats count would show count of admin events.
- ✗
The search command runs before the eval command.
Why it's wrong here
The pipeline runs in order; eval happens before search.
Go deeper
Related to this question
About these practice questions
One of 475 original SPLK-1002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.