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!

Take the 2021 Splunk Career Survey for $50 in Amazon Cash

Help us learn about how Splunk has impacted your career by taking the 2021 Splunk Career Survey. Last year’s ...

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

Observability Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestSplunk APM's New Tag Filter ExperienceSplunk APM has updated ...