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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...