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.
@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.
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.
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
latest properties in dropdown's dynamic query to populate the results based on the time range selected by the user as
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>
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