Courseiva
Macros, Saved Searches and CIMeasyMultiple ChoiceObjective-mapped

SPLK-1002 Macros, Saved Searches and CIM Practice Question

Exhibit

| stats count by host, sourcetype

Refer to the exhibit. The macro `count_by_host` is defined as shown. The macro is invoked as `| `count_by_host`. What will the expanded search look like?

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

`| | stats count by host, sourcetype`

Since the macro definition includes a leading pipe, invoking it with `| `count_by_host` results in two pipes – one from the invocation and one from the definition. So the expanded search becomes `| | stats count by host, sourcetype`. Option A would be missing the second pipe, option B shows the macro invocation unexpanded, and option C would be missing both pipes.

Answer analysis

Option-by-option breakdown

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

  • `| stats count by host, sourcetype`

    Why it's wrong here

    Incorrect: Missing one pipe.

  • `| `count_by_host`

    Why it's wrong here

    Incorrect: Macro not expanded.

  • `stats count by host, sourcetype`

    Why it's wrong here

    Incorrect: Missing both pipes.

  • `| | stats count by host, sourcetype`

    Why this is correct

    Correct: Double pipe due to leading pipe in macro definition.

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 →

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.