Dashboards & Visualizations

Is there a way to allow time picker sharing for dropdown input options on dashboards?

asunder123
Engager

hii ,

I have been trying to find ways to enable time picker sharing for the dropdown input options that is available in Dashboards in order to populate field values based on time range selected. Currently time sharing is available only in panels during edit mode and not in any of the field selection options like drop down, multiselect or checkbox options.

aaraneta_splunk
Splunk Employee
Splunk Employee

@asunder123 - Did one of the answers below help provide a solution your question? If yes, please click “Accept” below the best answer to resolve this post. If no, please leave a comment with more feedback. Thanks.

0 Karma

niketn
Legend

In order to use earliest and latest time in the search for Dynamic Option you would have to explicitly define the token within the Search String.

Assuming your time control has token globalTime then, in the Search String for the drop down your can write your search as follows:

index=<yourIndex> sourcetype=<yourSourceType> earliest=$globalTime.earliest$ latest=$globalTime.latest$ | <Your reaming Search Goes here>

Please let me know if you need example.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

adamcoquim
Explorer

Hi niketnilay, would it be possible to get an example for the Dynamic Option?

0 Karma

gokadroid
Motivator

I think there is a way by editing the xml and using the token.
Name your timepicker's token, say myTimePickerToken, in the first line of xml code of timepicker input <input type="time" searchWhenChanged="true" token="myTimePickerToken">

Then use this token's earliest and latest properties in dropdown's dynamic query to populate the results based on the time range selected by the user as <earliest>$myTimePickerToken.earliest$</earliest> and <latest>$myTimePickerToken.latest$</latest>

Code snippet is below for dropdown, you may try others:

<input type="time" searchWhenChanged="true" token="myTimePickerToken">
      <label></label>
      <default>
        <earliest>-4h@m</earliest>
        <latest>now</latest>
      </default>
    </input>
    <input type="dropdown" searchWhenChanged="true" token="myDropDownToken">
      <label>Front End</label>
      <choice value="*">All</choice>
      <search>
        <query>index=myIndex sourcetype=mySourcetype | Stats count by myField1</query>
        <earliest>$myTimePickerToken.earliest$</earliest>
        <latest>$myTimePickerToken.latest$</latest>
      </search>
      <fieldForLabel>myField1</fieldForLabel>
      <fieldForValue>myField1</fieldForValue>
    </input>

SR_70
Explorer

I used your example code and got the results as expected. 

 Thank you!

0 Karma

somesoni2
Revered Legend

I don't think that feature is available (assigning shared time-range picker for Dynamic options of the form inputs) as of 6.5.0. I think it would be good feature to be requested in future releases.

You can file an enhancement request by submitting a Priority 4 - Enhancement Request ticket at http://www.splunk.com/index.php/submit_issue

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...