Dashboards & Visualizations

how to give radio button to choose for business hours or 24/24 in my dashboard

surekhasplunk
Communicator

Hi,

I want to give an option to user to choose using radio button the Time Window.

1st option - 24/24
2nd option - 9AM -6PM

Now how to set this token and its values and use it in the dashboard query ?

Tags (3)
0 Karma
1 Solution

vnravikumar
Champion

Hi

Give a try

<form>
   <label>Date</label>
   <fieldset submitButton="false">
     <input type="radio" token="dateTime">
       <label>field1</label>
       <choice value="24/24">24/24</choice>
       <choice value="9AM -6PM">9AM -6PM</choice>
       <change>
         <condition label="24/24">
           <set token="custom_earliest">@d</set>
           <set token="custom_latest">@d+23h+59m</set>
         </condition>
         <condition label="9AM -6PM">
           <set token="custom_earliest">@d+9h</set>
           <set token="custom_latest">@d+18h</set>
         </condition>
       </change>
     </input>
   </fieldset>
   <row>
     <panel>
       <table>
         <search>
           <query>index="_internal"|dedup _time | table _time</query>
           <earliest>$custom_earliest$</earliest>
           <latest>$custom_latest$</latest>
         </search>
         <option name="drilldown">none</option>
       </table>
     </panel>
   </row>
 </form>

View solution in original post

0 Karma

vnravikumar
Champion

Hi

Give a try

<form>
   <label>Date</label>
   <fieldset submitButton="false">
     <input type="radio" token="dateTime">
       <label>field1</label>
       <choice value="24/24">24/24</choice>
       <choice value="9AM -6PM">9AM -6PM</choice>
       <change>
         <condition label="24/24">
           <set token="custom_earliest">@d</set>
           <set token="custom_latest">@d+23h+59m</set>
         </condition>
         <condition label="9AM -6PM">
           <set token="custom_earliest">@d+9h</set>
           <set token="custom_latest">@d+18h</set>
         </condition>
       </change>
     </input>
   </fieldset>
   <row>
     <panel>
       <table>
         <search>
           <query>index="_internal"|dedup _time | table _time</query>
           <earliest>$custom_earliest$</earliest>
           <latest>$custom_latest$</latest>
         </search>
         <option name="drilldown">none</option>
       </table>
     </panel>
   </row>
 </form>
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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