Dashboards & Visualizations

How to hide dashboard panel results until search is complete.

iamsplunker31
Path Finder

Hello Splunk Community.
We have a dashboard with 8 panels. The dashboard has 2 text boxes where we can use to enter start date with time and end date with time & it also has a drop down to select the panel we want. I would like to hide the dashboard results until search is complete and then display the results. Now the issue is .. it is hiding the results when we first open a dashboard and enter the inputs (Start and end date)
but when we switch the panels it didn't work. It only works for the first time . Here is the code I'm using.

<panel rejects="$hide_progress_panel$">
          <html>
              <p align="center">Loading, please wait...</p>
   </html>
</panel>
                     </row>
               <row>
<panel depends="$Apple-details$,$hide_progress_panel$">



--

<finalized>
    <set token="hide_progress_panel">true</set>
</finalized>
0 Karma
1 Solution

niketn
Legend

@iamsplunker31 try the following code block to your existing search. When the search query runs the token should be unset using <progress> Search Event Handler and only when the search completes it should be set using <done> Search Event Handler.

PS: <finalized> search event handler has been deprecated since Splunk Enterprise 6.4.

 <progress>
     <unset token="hide_progress_panel"></unset>
 </progress>
 <done>
     <set token="hide_progress_panel">true</set>
 </done>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

woodcock
Esteemed Legend

Thank you for crediting the BEST answer by @niketnilay.

woodcock
Esteemed Legend

Try this:

  <html>
     <p align="center">Loading, please wait...</p>
  </html>
</panel>



  <progress>
     <unset token="hide_progress_panel"></unset>
  </progress>
  <done>
     <set token="hide_progress_panel">true</set>
  </done>
0 Karma

iamsplunker31
Path Finder

Thank you @woodcock.
It worked.

niketn
Legend

@woodcock small correction, closing node for <unset> should be </unset> not </set>

  <unset token="hide_progress_panel"></unset>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

woodcock
Esteemed Legend

Good point; I fixed it. And I see that you posted the same answer (without the typo) shortly before I did, so really, @iamsplunker31, you should UnAccept my answer and Accept the one from @niketnilay.

0 Karma

niketn
Legend

@iamsplunker31 try the following code block to your existing search. When the search query runs the token should be unset using <progress> Search Event Handler and only when the search completes it should be set using <done> Search Event Handler.

PS: <finalized> search event handler has been deprecated since Splunk Enterprise 6.4.

 <progress>
     <unset token="hide_progress_panel"></unset>
 </progress>
 <done>
     <set token="hide_progress_panel">true</set>
 </done>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

Maya
Loves-to-Learn Lots

I have a requirement to hide the results from a panel until search is not complete.  WHen I am using below, it is hiding the panel until result is not coming. 

 

Can you please suggest how can I see the pannel but, not the results until search is not complete. 

<panel depends="$hide_progress_panel$">
<table>
<search>

<query>index="_internal"
|table *</query>
<earliest>-30d@d</earliest>
<latest>now</latest>
<sampleRatio>1</sampleRatio>
<progress>
<unset token="hide_progress_panel"></unset>
</progress>
<done>
<set token="hide_progress_panel">true</set>
</done>

0 Karma

iamsplunker31
Path Finder

Thank you @niketnilay. This resolves my issue

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...