Courseiva
Advanced Searching and StatisticsmediumMultiple ChoiceObjective-mapped

SPLK-1002 Advanced Searching and Statistics Practice Question

A search includes `... | eval day=strftime(_time, "%A") | stats count by day | sort count`. The results show Monday has the highest count. The analyst wants to confirm that the timezone is correctly applied. Which command should be added before the eval to ensure the day calculation uses the local timezone?

⚠ Common exam trap

Splunk often tests the misconception that `strftime` automatically respects the user's local timezone, when in fact it uses the search head's timezone setting, requiring manual offset adjustment for accurate local-time calculations.

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

`... | eval _time=_time + (your_tz_offset*3600) | eval day=strftime(_time, "%A") ...`

The `strftime` function uses the server's timezone by default, which may not match the local timezone. By manually adding the timezone offset (in seconds) to `_time` before the `eval`, you shift the epoch timestamp to reflect the local time, ensuring that `strftime` calculates the correct day of the week. This is a common workaround when the search head's timezone differs from the user's local timezone.

Answer analysis

Option-by-option breakdown

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

  • `... | eval day=strptime(_time, "%A") | ...`

    Why it's wrong here

    strptime converts string to epoch, not applicable here.

  • `... | fields + _time, day | ...`

    Why it's wrong here

    fields just selects fields, does not affect timezone.

  • `... | eval _time=_time + (your_tz_offset*3600) | eval day=strftime(_time, "%A") ...`

    Why this is correct

    Correct: adjusting _time by timezone offset before extracting day.

  • `... | convert ctime(_time) | eval day=strftime(_time, "%A") ...`

    Why it's wrong here

    convert ctime only changes display format, not the underlying epoch; strftime still uses UTC.

  • `... | eval _time=relative_time(_time, "-0@d") | eval day=strftime(_time, "%A") ...`

    Why it's wrong here

    relative_time rounds to day, doesn't adjust timezone.

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 →

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.