Courseiva
Macros, Saved Searches and CIMhardMultiple SelectObjective-mapped

SPLK-1002 Macros, Saved Searches and CIM Practice Question

An admin is troubleshooting a saved search that uses the `| `my_macro` command. The macro definition is `stats count by $1$`. The saved search is scheduled to run hourly. Which of the following issues could cause the saved search to fail? (Choose three.)

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 macro argument passed in the saved search contains a space without quotes

Options A, B, and D are correct. A: If the macro argument contains a space without quotes, it will be parsed incorrectly. B: If the macro definition includes a pipe at the start but the invocation also includes a pipe, the double pipe causes a syntax error. D: If the macro is not shared to the app where the saved search is stored, the saved search cannot access it. C: 'All time' time range is not a direct cause of failure. E: Overlap might cause skip but not necessarily failure.

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 macro argument passed in the saved search contains a space without quotes

    Why this is correct

    If the macro argument contains a space without quotes, it will be parsed incorrectly.

  • The macro definition includes a pipe at the start but the invocation also includes a pipe

    Why this is correct

    If the macro definition includes a pipe at the start but the invocation also includes a pipe, the double pipe causes a syntax error.

  • The saved search's time range is set to 'All time'

    Why it's wrong here

    Incorrect: 'All time' may not cause failure, though it can be resource-intensive.

  • The macro is not shared to the app where the saved search is stored

    Why this is correct

    Correct: Macro must be accessible to the saved search's app.

  • The saved search has a cron schedule that overlaps with another saved search

    Why it's wrong here

    Incorrect: Overlap may cause skip but not failure.

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

Same concept, more angles

2 more ways this is tested on SPLK-1002

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. An admin notices that a saved search with a scheduled alert is not triggering as expected even though the search returns results. The search uses a macro with arguments. Which troubleshooting step should the admin take first?

medium
  • A.Ensure that the macro name does not conflict with existing commands or other macros.
  • B.Review the macro definition for syntax errors, such as missing brackets or incorrect argument references.
  • C.Verify the macro's permissions are set to global.
  • D.Check the search head's job inspector for the expanded search string.

Why B: When a saved search using a macro with arguments fails to trigger despite returning results, the admin should first review the macro definition for syntax errors (Option B). Common issues include missing brackets, incorrect argument references, or improper use of pipe characters within the macro. This is the most direct troubleshooting step because the macro may be defined incorrectly, causing the alert to fail even though the search itself returns results when run manually. Option A (name conflicts) is possible but less likely and should be checked after syntax. Option C (permissions) is irrelevant if the macro is used in a saved search that already runs. Option D (job inspector) is useful for deeper analysis but not the first step.

Variation 2. A Splunk admin has created several macros to simplify complex search commands. One macro, named `time_filter`, is defined as `earliest=-7d@d latest=@d`. The admin also has a saved search that uses this macro. Recently, users have complained that the saved search reports data from the wrong time range: it appears to be showing data from the last 24 hours instead of the last 7 days. The admin inspects the saved search and finds that the search string is: `index=main | eval days=now() | where days > relative_time(now(), "-7d@d") | `time_filter`` The admin suspects the macro is not being expanded correctly. Which of the following is the most likely cause of the issue?

medium
  • A.The macro definition includes arguments (`$earliest$`, `$latest$`), but the invocation does not pass any arguments; thus, the macro expands to nothing.
  • B.The saved search permissions are set to 'Private', so the macro does not apply.
  • C.The macro should be invoked with a pipe, like `| time_filter` instead of backticks.
  • D.The macro is disabled; the admin needs to enable it in the macros list.

Why D: The macro `time_filter` is defined as `earliest=-7d@d latest=@d`, but if it is disabled, it will not be expanded when invoked with backticks. Consequently, the search runs without the specified time range, defaulting to the last 24 hours, which explains the user reports. The admin should verify and enable the macro in the settings.

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.