Dashboards & Visualizations

Is it possible to reuse the tokens from the timerangepicker later in a form?

HeinzWaescher
Motivator

Hi,

I'm wondering whether it is possible to reuse the tokens from the timerangepicker in a form.

  1. The panels interacts as usual when the timerangepicker is used
  2. In a later pipe I would like to reuse the chosen time tokens from the timerangepicker (earliest & latest) for another calculated field (!= _time).

Is that possible?
thanks in advance

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi HeinzWaescher,
yes, it's possible, if your Time Picker Token is called "Time", you can use $Time.earliest$ and $Time.latest$ as usual tokens.
Bye.
Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi HeinzWaescher,
yes, it's possible, if your Time Picker Token is called "Time", you can use $Time.earliest$ and $Time.latest$ as usual tokens.
Bye.
Giuseppe

HeinzWaescher
Motivator

Awesome, that's something I hoped for. This will make things a lot easier 🙂
Thanks

0 Karma

HeinzWaescher
Motivator

I recognized that this can't handle relative times used in the timerange picker. Earliest and latest are not converted into epochtime.

For example this results in:

| search creation_ts>=-2w@w1 AND creation_ts<=@d

Can we solve these cases directly in this search pipe? Or the best solution to tell dashboard users only to select date ranges?

0 Karma

HeinzWaescher
Motivator

I found an answer that seems to help here:
Like:

| where creation_ts< [|gentimes start=-1 | addinfo | eval search=info_max_time | table search]

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi HeinzWaescher,
if you display earliest and latest in a dashboard, you see that they are displayed in epochtime.
To use in search, use the where command instead search and use brackets:

| where creation_ts>="$Time.earliest$" AND creation_ts<="$Time.latest$"

Bye.
Giuseppe

0 Karma

HeinzWaescher
Motivator

Hm, I'm still facing the problem.

Used timerangepicker: -2w@w1 to @d

My search filter is:

| where creation_ts>="$Timer.earliest$" AND creation_ts<="$Timer.latest$"

Doing a stats afterwards it shows:
man(creation_ts)=2016-12-14 (this should not be possible after there where command)
max(creation_ts)=2017-08-01

When I open the finalized search from the panel, there where clause is shown as:
| where creation_ts>="-2w@w1" AND creation_ts<="@d"

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...