My Splunk dashboard contains a timepicker along with a search results panel which displays a table output. The dashboard can be accessed by passing a input parameter 'form.queryParam.earliest' from another dashboard. Or it can directly be accessed independently without passing a parameter.
The expected behavior is:
If accessed with the input parameter, on loading, the results should be shown based on query param passed.
Now, if the value of the timepicker is changed, it should refresh the search and update the results.
If accessed without the input parameter, the results should be shown based on the default value of the time picker.
Now, if the timepicker value is changed, it should refresh the search and update the results.
With this in mind, I configured it with the following.
<form>
<label>Test Dashboard</label>
<fieldset submitButton="false" autoRun="true">
<input type="time" token="selectedTimestamp" searchWhenChanged="true">
<label>Time</label>
<default>
<earliest>-1d@d</earliest>
<latest></latest>
</default>
<change>
<set token="timeChanged">true</set>
</change>
</input>
</fieldset>
<!-- DUMMY SEARCH TO EVALUATE FINAL VALUE BASED ON CONDITIONS -->
<search>
<query>| makeresults</query>
<earliest>-1s@s</earliest>
<latest>now</latest>
<done>
<eval token="finalEarliest">case(isnotnull($timeChanged$), $form.selectedTimestamp.earliest$, isnotnull($form.queryParam.earliest$), $form.queryParam.earliest$, true(), $form.selectedTimestamp.earliest$)</eval>
</done>
</search>
<!-- ACTUAL SEARCH -->
<row>
<panel>
<title>Results Tale</title>
<table>
<search>
<query>ACTUAL QUERY</query>
<earliest>$finalEarliest$</earliest>
<latest>now</latest>
</search>
<option name="link.exportResults.visible">0</option>
<option name="link.inspectSearch.visible">0</option>
<option name="link.openPivot.visible">0</option>
<option name="link.openSearch.visible">0</option>
<option name="refresh.link.visible">0</option>
<format type="color" field="percent_of_total_count">
<colorPalette type="list">[#65A637,#6DB7C6,#F7BC38,#F58F39,#D93F3C]</colorPalette>
<scale type="threshold">0,30,70,100</scale>
</format>
</table>
</panel>
</row>
</form>
I am having 2 problems with this.
The timeChanged value always returns true because of which the dashboard always loads with the default value of the timepicker even when the input parameter is passed in the url.
The search results don't get refreshed when the timepicker value is changed in the dropdown.
Can someone please help.
Regards.
... View more