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!

Stay Connected: Your Guide to July and August Tech Talks, Office Hours, and Webinars!

Dive into our sizzling summer lineup for July and August Community Office Hours and Tech Talks. Scroll down to ...

Edge Processor Scaling, Energy & Manufacturing Use Cases, and More New Articles on ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Get More Out of Your Security Practice With a SIEM

Get More Out of Your Security Practice With a SIEMWednesday, July 31, 2024  |  11AM PT / 2PM ETREGISTER ...