I have three panels in my dashboard.Panel1 & Panel2
—> have some query and fetch me some result. Panel3
—> just have custom text which displays whenever the Panel1 & Panel2 do not have any results.
Requirements:
1. Hide Panel1 & Panel2
when job result is 0. Show the Panel 3
2. Hide Panel 3
when job result is !=0. Show the Panel & Panel2
I have used the below code to hide the Panel1 & Panel2 when there are no results
<progress>
<condition match="$job.resultCount$ == 0">
<unset token="hide_panel2"></unset>
</condition>
<condition>
<set token="hide_panel2">true</set>
</condition>
</progress>
There is no issue with this. Its working fine.
But my Panel3 has to be hidden whenever the Panel1 & Panel2 are visible. As like above code, I have tried the similar set of code to hide Panel3 based on Panel1 & Panel2 values
<progress>
<condition match="$result.Usage_Count$ != 0">
<unset token="hide_panel3"></unset>
</condition>
<condition>
<set token="hide_panel3">true</set>
</condition>
</progress>
But still the panel3 is visible in all kind of conditions. I am not knowing where I am making the mistake. Could anyone please help me.
Hi
Try this
<dashboard>
<label>panel</label>
<row>
<panel rejects="$hide_panel$">
<table>
<title>Panel1</title>
<search>
<query>index="_internal" |stats count by host </query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<progress>
<condition match="$job.resultCount$ == 0">
<set token="hide_panel">true</set>
</condition>
<condition>
<unset token="hide_panel"></unset>
</condition>
</progress>
</search>
<option name="drilldown">none</option>
</table>
</panel>
<panel rejects="$hide_panel$">
<table>
<title>Panel2</title>
<search>
<query>index="_internal" |stats count by host |stats count by host </query>
<earliest>-24h@h</earliest>
<latest>now</latest>
<progress>
<condition match="$job.resultCount$ == 0">
<set token="hide_panel">true</set>
</condition>
<condition>
<unset token="hide_panel"></unset>
</condition>
</progress>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
<row>
<panel depends="$hide_panel$">
<table>
<title>Panel3</title>
<search>
<query>index="_internal" |stats count by host</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="drilldown">none</option>
</table>
</panel>
</row>
</dashboard>