Splunk Search

how to subtract timepicker's (Number of days) from bar chart's click.value?

sanjum01
Explorer

Hi Folks,

I have below requirement,

I have a dashboard where I have timepicker with token and and bar chart panel. so lets see if i choose 15days

from timepicker it shows data in15 bars (Oct 20th to Nov 3rd). so now lets suppose I click on a bar

($click.value$) it takes me to next panel where I want to see the data from $click.value$ to 15 PREVIOUS days.

e.g if i click on bar of Oct 20th, the next panel should show me data for past 15 days (6th Oct to 20th Oct).

can someone help me with setting up earliest and latest time through tokens for above scenario?




Labels (3)
Tags (3)
0 Karma

sanjum01
Explorer

so it means if i take the value from time picker as a token I can try  like below?  because number is not always going to be 15 it depends on what user select on time picker.

 

 

 

<eval token="newearly">relative_time($click.value$,"-TokenTimePicker")</eval>

 

 

 
 
0 Karma

sanjum01
Explorer

@ITWhisperer the solution you provided works with fixed number of days in eval. but I need to give the number from time picker..
here is what I have.

<fieldset submitButton="false">
<input type="time" token="field1">
<label></label>
<default>
<earliest>-7d@d</earliest>
<latest>now</latest>
</default>
.
.
.
.
<drilldown target="_blank">
<set token="datatype_value">$click.value$</set>
<set token="time1">$click.value$</set>
<eval token="time2">relative_time($click.value$, "-$field1$")</eval>
<link target="_blank">/app/search/trend_by_source_clone_2?form.Datatype1="Lab"&amp;form.second_dash.earliest=$form.field1.earliest$&amp;form.time1=$time1$&amp;form.time2=$time2$</link>
</drilldown>

any help please??

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

<eval token="newearly">relative_time($click.value$,"-15d")</eval>
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...