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

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...