Dashboards & Visualizations

How to create dependency between dropdown and time range picker in one dashboard?

sayanidasgupta
Explorer

I have a dashboard, where I need to add one dropdown with values like LOR, LTDS, then need to create one Time span picker like 30 minutes, 1 hour, 1 day and then the time range i.e for last 7 days or 30 days.

Each item means dropdown, time span and time range has to be dependent on the previous one...

Please help me out.

Tags (1)
0 Karma

mayurr98
Super Champion

Okay, so how you are getting LOR,LDTS..etc values? you would need to write a search for that

Refer to this run anywhere XML

<form>
  <label>test_</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" token="log_level">
      <label>log_level</label>
      <choice value="*">ALL</choice>
      <initialValue>*</initialValue>
      <fieldForLabel>log_level</fieldForLabel>
      <fieldForValue>log_level</fieldForValue>
      <search>
        <query>index=_internal | dedup log_level | table log_level</query>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
    </input>
    <input type="dropdown" token="span">
      <label>span</label>
      <choice value="30m">30 Minutes</choice>
      <choice value="1h">1 hour</choice>
      <choice value="7d">7 days</choice>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_internal log_level=$log_level$ | timechart span=$span$ count</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>

let me know if this helps!

0 Karma

mayurr98
Super Champion

can you tell me what it is dependent on?
do you mean 30 minutes time span should be selected when we select LOR, 1 hour for LTDS?

0 Karma

sayanidasgupta
Explorer

No, not lyk dt.

I need to have a dropdown listing all services - LOR, LTDS etc. we can select one at a time or there has to be a option - All

next I need to have a time span for 30 minute, 1 hour, 1 day or 7 days, not LOR for 1 day lyk dt, we can select any, we need to specify some values only not all values like time range picker.

Then another time range picker for time period like default time range picker.

e.g we need a chart for all services for past 30 days and span will be 1 day - means graph will give 30 line chart (as span is selected as 1 day) for all services.

OR

Need a chart for LOR service for past 1 day on hourly basis means it will give 24 line for 1 day for particular LOR service

0 Karma
Get Updates on the Splunk Community!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...