How do you hide dashboard panel when search results=0 but you have multiple dashboard panels you want to use this function for.
Currently having an issue when I add this code to .xml it hides both panels if only one of them displays results =0. Do I need to add a search ID or Panel ID to differentiate between the two panels. See below example
<panel>
<title>$form.Store$</title>
<table depends="$hide.table$">
<search>
<query>| my search</query>
<earliest>-4h@m</earliest>
<latest>now</latest>
<done>
<condition match="'job.resultCount' == 0">
<set token="hide_table">true</set>
</condition>
<condition>
<unset token="hide_table"></unset>
</done>
</search>
</table>
</panel>
<title>$form.Store$ Tills</title>
<table depends="$hide.table$">
<title>Please investigate</title>
<search>
<query>| my search</query>
<earliest>-7d@d</earliest>
<latest>-0d@d</latest>
<sampleRatio>1</sampleRatio>
<done>
<condition match="'job.resultCount' == 0">
<set token="hide_table">true</set>
</condition>
<condition>
<unset token="hide_table"></unset>
</done>
</search>
</table>
</panel>
Many thanks.
I always just keep the panels and add this to the SPL:
| appendpipe [stats count | where count=0]
I always just keep the panels and add this to the SPL:
| appendpipe [stats count | where count=0]
What do you mean by the above code? I'm not sure I understand why or where I would use this to solve the problem of hiding dashboard panels with no results found.
This solution does not hide the panel but it hides the "no results found" message.
<earliest>-4h@m</earliest>
<latest>now</latest>
<progress>
</progress>
<condition match="'job.resultCount' == 0">
<set token="hide_table">true</set>
</condition>
I have see extra <condition> above unset token
but that still hides both panels even if only one panel is displaying results = 0
<panel>
<title>$form.Store$</title>
<table depends="$hide.table$">
<search>
<query>| my search</query>
<earliest>-4h@m</earliest>
<latest>now</latest>
<progress>
<set token="job.resultCount">tonumber('job.resultCount')</set>
</progress>
<condition match="'job.resultCount' == 0">
<set token="hide_table">true</set>
<unset token="hide_table1"><unset>
</condition>
</search>
</table>
</panel>
<title>$form.Store$ Tills</title>
<table depends="$hide_table$">
<title>Please investigate</title>
<search>
<query>| my search</query>
<earliest>-7d@d</earliest>
<latest>-0d@d</latest>
<sampleRatio>1</sampleRatio>
<progress>
<set token="job.resultCount">tonumber('job.resultCount')</set>
</progress>
<condition match="'job.resultCount' == 0">
<set token="hide_table1">true</set>
<unset token="hide_table"></unset>
</condition>
</search>
</table>
</panel>