3.2 Setting Time Ranges
Key Takeaways
- Every search is bounded by earliest and latest time against event `_time`; the Time Range picker is the primary UI control next to the Search bar.
- Presets (Last 15 minutes, Last 24 hours, Yesterday, All time, and similar) are the fastest way to set common windows; Relative and Date Range tabs customize windows.
- Real-time searches stream continuously within a sliding window and keep consuming resources until stopped—distinct from historical (non-real-time) searches.
- SPL time modifiers use earliest/latest with units like s, m, h, d, w, mon, y and optional snap-to anchors such as -24h@h or -7d@d.
- Narrow time ranges are the highest-leverage performance control for User-level searches because Splunk stores data in time-oriented buckets.
3.2 Setting Time Ranges
Quick Answer: Use the Time Range picker (or
earliest/latestin SPL) to bound_time. Presets and relative windows cover most User work; real-time windows stream continuously; snap-to modifiers like-24h@hand-7d@dalign boundaries to clock units.
Topic 2.2 Set the time range of a search sits inside the 22% Basic Searching domain. Splunk’s storage and search engine are time-centric: events are stored in time-bounded buckets, and nearly every efficient search starts by limiting earliest and latest.
Why time range is not optional thinking
If two analysts run the same keywords—one with Last 15 minutes, one with All time—they can get radically different runtimes and result volumes. The exam expects you to recognize:
- Where the time control lives in the UI
- What preset / relative / real-time / date-range mean
- How relative modifiers read in SPL (
earliest=-24h@h) - That time filtering uses the event timestamp field
_time(not “when you clicked Search,” and not_indextimeunless a specialized modifier is used—User focus stays on_time)
The Time Range picker
Immediately beside the Search bar, the Time Range picker dropdown shows the active window (for example, “Last 24 hours”). Opening it reveals tabs/sections commonly including:
| Picker area | Purpose | Typical User examples |
|---|---|---|
| Presets | One-click common windows | Last 15 minutes, Last 60 minutes, Last 24 hours, Last 7 days, Last 30 days, Today, Week to date, All time |
| Relative | Build “N units ago” windows | Earliest = 4 hours ago, Latest = now |
| Real-time | Streaming windows | 30-second window, 1-minute window, 5-minute window |
| Date Range | Calendar start/end dates | From 2026-07-01 to 2026-07-31 |
| Date & Time Range | Precise timestamps | From 2026-07-01 08:00 to 2026-07-01 17:00 |
After you choose a value, the label on the picker updates. The next time you click Search, the job uses that window.
Presets versus custom relative
Presets are shortcuts for relative (and a few special) windows. They are ideal for ad-hoc investigation and for exam questions that name “Last 24 hours” style options.
Relative (custom) is for windows that are not on the preset list—for example, “beginning 90 minutes ago through now,” or “from 2 days ago to 1 day ago.” Relative controls usually ask for:
- How far back earliest is (amount + unit)
- How far back latest is (often “now”)
Real-time versus historical
| Kind | Behavior | When User candidates use it |
|---|---|---|
| Historical (non-real-time) | Searches events already indexed in a fixed window; job progresses to completion | Most reports, investigations, stats |
| Real-time | Continuously updates as new matching events arrive inside a sliding window | Watch a live feed; short operational monitoring |
Real-time searches keep working until you stop them and can load the system more heavily. Exam items often contrast “Last 15 minutes” (historical) with a “15-minute real-time window” (streaming).
Date Range / Date & Time Range
Use these when you need a calendar-bound investigation: a change window last Tuesday 14:00–16:00, or an entire month for a capacity review. Absolute ranges are exact; relative ranges “move” as wall-clock time advances if you re-run the search later.
earliest and latest: the underlying model
Regardless of UI tab, Splunk converts your choice into earliest and latest bounds evaluated against _time.
| Concept | Meaning |
|---|---|
| earliest | Oldest _time included (start of the window) |
| latest | Newest _time included (end of the window); often “now” |
| Window | Events with _time satisfying earliest ≤ _time < latest (product edge semantics can treat endpoints carefully; conceptually you are clipping a half-open or closed interval of time) |
Omitting an explicit latest in SPL commonly defaults to now. Omitting earliest without a picker default is dangerous—UI always has some selected range.
Relative time modifiers in SPL
You can embed time in the search string (or in saved-search definitions) using modifiers:
earliest=-15m
earliest=-24h latest=now
earliest=-4h latest=-2h
Common time units
| Unit token | Meaning |
|---|---|
s | seconds |
m | minutes |
h | hours |
d | days |
w | weeks |
mon | months |
y | years |
Examples:
earliest=-30s— last 30 seconds (historical window ending at now if latest omitted/defaulted)earliest=-24h— from 24 hours before nowearliest=-7d— from 7 days before now
Snap-to with @ (critical User skill)
A snap-to anchor rounds the relative time to the start of a unit. Syntax pattern:
-24h@h
-7d@d
-1mon@mon
Read -24h@h as: go back 24 hours, then snap to the beginning of that hour. Read -7d@d as: go back 7 days, then snap to the beginning of that day (typically midnight in the applied timezone context).
| Modifier | Plain-language reading |
|---|---|
earliest=-15m | Fifteen minutes before now (no snap) |
earliest=-24h@h | Twenty-four hours ago, aligned to the hour boundary |
earliest=-7d@d | Seven days ago, aligned to the day boundary |
earliest=-1d@d latest=@d | From yesterday’s day boundary through today’s day boundary (today so far, depending on exact latest) |
Snap-to matters for clean daily/hourly reporting. Without @d, “last 7 days” drifts by the current time of day; with @d, day boundaries line up for apples-to-apples charts.
Combining picker and SPL
If both the picker and SPL specify time, understand that explicit SPL earliest/latest participate in defining the job’s time bounds—practice in your lab how your Splunk version resolves conflicts. For the exam, be fluent reading modifiers and picker labels; questions usually present one clear mechanism.
Worked examples
Example A — Preset
Picker: Last 24 hours. Search: error.
Result: events whose _time falls in the last day, matching error.
Example B — Relative SPL
index=net earliest=-4h latest=-1h firewall DROP
Events from four hours ago up to one hour ago (not the most recent hour).
Example C — Snap-to
index=app earliest=-7d@d latest=@d
From the start of the day seven days ago through the start of today—useful for complete prior days without a partial “today” if latest is @d only (interpret carefully: @d alone as latest often means “beginning of today,” so the window may exclude the partial current day). Adjust latest to now when you need “through this moment.”
Example D — Real-time preset
Picker: 30-second window real-time. Search: sourcetype=syslog.
Events stream as they arrive; stop the job when finished watching.
Performance and investigation discipline
| Practice | Benefit |
|---|---|
| Start narrow (15–60 minutes), then widen | Faster iteration; less noise |
| Prefer presets you understand over All time | Avoid accidental full-history scans |
| Use snap-to for daily report windows | Stable day boundaries |
| Reserve real-time for genuine live needs | Lower sustained load |
Exam-style traps
- All time is valid but rarely wise on large indexes—questions may ask what expands the search the most.
- Real-time is not the same as Last 15 minutes historical.
-24hvs-24h@h— only the second snaps to the hour.- Time range filters
_time, the event timestamp—mis-parsed timestamps at index time can make events “missing” from an expected window (awareness only; parsing deep-dives are beyond basic 2.2 UI skill).
Mini workflow checklist
- Decide historical vs real-time.
- Pick preset, relative custom, or absolute date/time.
- Confirm the picker label before clicking Search.
- For saved/logical clarity, recognize
earliest/latestand snap-to forms like-24h@hand-7d@d.
Time range mastery is the difference between a one-second search and a ten-minute wait—and Domain 2.2 tests that judgment directly.
Which Splunk field do the Time Range picker’s earliest and latest bounds primarily filter on for a normal user search?
What does the relative modifier earliest=-7d@d most accurately describe?
How does a real-time time range differ from a historical “Last 15 minutes” preset?