Splunk Search

How to pass a time preset string (e.g. Last 30 days) to a form through the URL?

wcooper003
Communicator

I want to populate a time picker to display "Last 30 days" through a URL link. Currently I do something like this:

/app/itoa_test/pivot?dataset=Interactions&type=datamodel&earliest=-30d

However, this populates the time picker to display "Custom time". This "Custom time" may not be obvious to the users as to what time they're actually looking at right away, so i'd like the time picker box to show "Last 30 days" instead. Can a pass that Preset as a string in the URL somehow? For example (this clearly doesn't work):

/app/itoa_test/pivot?dataset=Interactions&type=datamodel&earliest="Last 30 days"

Thanks

0 Karma
1 Solution

somesoni2
Revered Legend

You need to provide both latest and earlier which matches the preset time range values. For Last 30 days , try like this

/app/itoa_test/pivot?dataset=Interactions&type=datamodel&earliest=-30d&latest=now

View solution in original post

0 Karma

somesoni2
Revered Legend

You need to provide both latest and earlier which matches the preset time range values. For Last 30 days , try like this

/app/itoa_test/pivot?dataset=Interactions&type=datamodel&earliest=-30d&latest=now
0 Karma

wcooper003
Communicator

Excellent thanks!

0 Karma
Get Updates on the Splunk Community!

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...

What's New in Splunk Observability - October 2025

What’s New?    We’re excited to announce the latest enhancements to Splunk Observability Cloud and share ...