Hi,
I have dashboard with multiple panels. Some of them I succeeded to only show them when there is a result. Now I would like this also for some single value vis.
The single value displays '0' when no result. But still is showing in the dashboard. How can I fix this?
</panel>
<panel depends="$panel_show4$">
<title>Test_Panel_4</title>
<single>
<search>
<progress>
<condition match="'job.resultCount' > 0">
<set token="panel_show4">true</set>
</condition>
<condition>
<unset token="panel_show4"></unset>
</condition>
</progress>
Can you please try this?
<row>
<panel depends="$panel_show4$">
<single>
<search>
<done>
<condition match="'job.resultCount' > 0">
<set token="panel_show4">true</set>
</condition>
<condition>
<unset token="panel_show4"></unset>
</condition>
</done>
<query>YOUR_SEARCH</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</single>
</panel>
</row>
I hope this will help you.
Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.
@kamlesh_vaghela Hi, sadly this does not make a difference. I suspect that it has something to do with the fact that splunk 'sees' the '0' in the single value as a result
Hi, I am not sure what is different in your suggestion.
I have this:
<panel depends="$panel_show4$">
<title>Test</title>
<single>
<search>
<progress>
<condition match="'job.resultCount' > 0">
<set token="panel_show4">true</set>
</condition>
<condition>
<unset token="panel_show4"></unset>
</condition>
</progress>
<query>My Search</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
<sampleRatio>1</sampleRatio>
</search>
<option name="drilldown">none</option>
<option name="rangeColors">["0x555","0xdc4e41"]</option>
<option name="rangeValues">[0]</option>
<option name="refresh.display">progressbar</option>
<option name="useColors">1</option>
</single>
</panel>
@kamlesh_vaghela uses <done> rather than <progress> - <done> is a more reliable way of determining when there are final results. For example, if the first part of your search finds results which are later removed by subsequent parts of your search, you may get a result count > 0 from <progress> which ends up as 0 in <done>