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!

.conf23 Registration is Now Open!

Time to toss the .conf-etti &#x1f389; —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...

Don't wait! Accept the Mission Possible: Splunk Adoption Challenge Now and Win ...

Attention everyone! We have exciting news to share! We are recruiting new members for the Mission Possible: ...

Unify Your SecOps with Splunk Mission Control

In today’s post, I'm excited to share some recent Splunk Mission Control innovations. With Splunk Mission ...