Courseiva
Advanced Searching and StatisticshardMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

A security analyst wants to create a comparison report showing the count of login failures by user for today versus yesterday. They run: `index=security action=failure | timechart count by user`. This produces a chart of counts over time, but they want separate columns for today and yesterday. How can they achieve this comparison efficiently?

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

Use `| eval day=if(_time>=relative_time(now(),"@d"),"today","yesterday") | timechart count by user by day`.

The correct approach is to use eval to create a day label (today vs yesterday) based on _time, then use timechart with the user and day fields to produce separate columns for each period. Option B does exactly that. Option A is incorrect because it uses append to combine two searches, but timechart with by period would not produce the desired side-by-side columns and is inefficient. Option C uses stats and xyseries, which can create a table but is less efficient and does not automatically limit to today and yesterday. Option D is incorrect because timechart with useother=t only groups low-count results into 'OTHER' and does not create separate columns for today and yesterday.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use `| append [search index=security action=failure earliest=-2d@d latest=-1d@d | eval period="yesterday"] | timechart count by user by period`.

    Why it's wrong here

    This option fails because `append` combines event sets sequentially, and the subsequent `timechart count by user by period` will still produce a time-series chart with a `_time` column, rather than distinct columns for "today" and "yesterday" as requested for a direct comparison. `timechart` is designed for visualising trends over time, not for creating a summary table with fixed comparative columns. It is tempting because `append` is effective for combining results from different time ranges into a single stream, which is useful when you want to display multiple time series on the same chart or perform further aggregations on a unified dataset.

  • Use `| eval day=if(_time>=relative_time(now(),"@d"),"today","yesterday") | timechart count by user by day`.

    Why this is correct

    Correctly categorizes events by day and creates separate columns.

  • Use `| stats count by user _time | xyseries _time user count`.

    Why it's wrong here

    This creates a matrix over time, not a direct today vs yesterday comparison.

  • Use `| timechart count by user useother=t` with the time range set to 'Yesterday' and 'Today' in the time picker.

    Why it's wrong here

    useother is not a valid timechart parameter for comparing time ranges.

About these practice questions

This SPLK-1002 question is part of Courseiva's 475-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.