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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...