Splunk Search

Can't seem to understand relative_time

sfghjkl
New Member

Hi,

I am working my way through some of the splunk courses. I am currently on "working with time".

In one of the videos the following command is used to find all results within the past day, rounding down.

"| eval yesterday = relative_time(now(),"1d@h")".

However when I attempt this command myself, it simply prints the "yesterday" value however it uses the time specified in my time picker, not in the actual command.

I was under the impression that any time specified within a command would automatically overwrite the time picker.

Was I mistaken in this? Or am I perhaps using the command incorrectly?

Any help would be greatly appreicated.

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The eval command merely assigns a value to a field (variable).  It has no effect on the time picker.

What *does* override the time picker are the earliest and latest options in the search command.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...