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!

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 ...