Splunk Enterprise

How to use 2 time range picker?

jip31
Motivator

hi

I need to filter events in my dashboard from 2 different time picker

I use a classic time range picker

 

  <input type="time" token="field1" searchWhenChanged="true">
      <label>Période</label>
      <default>
        <earliest>-7d@h</earliest>
        <latest>now</latest>
      </default>
    </input>

 

and a custom time range picker

 

 <input type="dropdown" token="release" searchWhenChanged="true">
      <label>Release</label>
      <choice value="26-27 Janvier">26-27 Janvier</choice>
      <choice value="16_17 Février">16-17 Février</choice>
      <change>
        <condition label="26-27 Janvier">
          <set token="custom_earliest">1643151600</set>
          <set token="custom_latest">1643324400</set>
        </condition>
        <condition label="16-17 Février">
          <set token="custom_earliest">1644966000</set>
          <set token="custom_latest">1645138800</set>
        </condition>
      </change>
      <default>26-27 Janvier</default>
      <initialValue>26-27 Janvier</initialValue>
    </input>

 

 now I need to link my search with these 2 different time range picker

I added | search release=$release$ in my search but it doesnt works

how to do this please?

 

Tags (2)
0 Karma
1 Solution

VatsalJagani
SplunkTrust
SplunkTrust

@jip31 - You can change the change attribute to something like this:

        <condition label="26-27 Janvier">
          <set token="field1.earliest">1643151600</set>
          <set token="field1.latest">1643324400</set>
        </condition>
        <condition label="16-17 Février">
          <set token="field1.earliest">1644966000</set>
          <set token="field1.latest">1645138800</set>
        </condition>

(Note field1 is token for time-range in your case)

 

I hope this helps!!!

View solution in original post

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@jip31 - You can change the change attribute to something like this:

        <condition label="26-27 Janvier">
          <set token="field1.earliest">1643151600</set>
          <set token="field1.latest">1643324400</set>
        </condition>
        <condition label="16-17 Février">
          <set token="field1.earliest">1644966000</set>
          <set token="field1.latest">1645138800</set>
        </condition>

(Note field1 is token for time-range in your case)

 

I hope this helps!!!

0 Karma
Get Updates on the Splunk Community!

Exciting News: The AppDynamics Community Joins Splunk!

Hello Splunkers,   I’d like to introduce myself—I’m Ryan, the former AppDynamics Community Manager, and I’m ...

The All New Performance Insights for Splunk

Splunk gives you amazing tools to analyze system data and make business-critical decisions, react to issues, ...

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...