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?

 

Labels (1)
Tags (2)
0 Karma
1 Solution

VatsalJagani
Super Champion

@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
Super Champion

@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!

Platform Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestIntroducing Splunk Edge Processor, simplified data ...

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...