Splunk Dev

How to hide "search is waiting for input..."when dashboard initially loads

knanaiah001
Explorer

Hello All,
Is there any way to hide the panel ("search is waiting for input..")
I've got a dashboard, in which , two panels are dependent  on the textbox input.
When the dashboard loads for the first time, my two panels will be 
showing "search is waiting for input..."
Here is my requirement : when the dashboard loads initially, my  textbox should be empty and i want to hide that warning message in panels instead display  "- -" in the panels  . I could make panel display with "- -" only if  i simply click/press enter on the textbox input after the initial dashboard with warning message .
Any suggestions to directly display the panels(want to hide--> "search is waiting for input") "- -" without clicking/pressing enter on the textbox?
Below image depicts how i need my dashboard  always without "search is waiting for input..."

Dashboard initial view  without"search is waiting input"Dashboard initial view without"search is waiting input"


0 Karma

niketn
Legend

@knanaiah001 if you need to show a custom panel/output when the text box is empty (on load or afterward), actual solution may differ based on how you are using the token in your SPL and how you are setting them. However, try the following run anywhere example where solution is based on rejects to display an empty html panel with -- as the output. You can use similar approach for your case.
PS: Based on the question asked, I am assuming you have a Submit button and there is no default option for the text box. I coded change event handler to unset the form token for the text box to ensure -- is displayed even when user manually clears the text box. Please try out and confirm!

 

<form>
  <label>Text Box based Search</label>
  <fieldset submitButton="true" autoRun="false">
    <input type="text" token="logLevel" searchWhenChanged="false">
      <label>Log Level</label>
      <change>
        <condition value="">
          <unset token="form.logLevel"></unset>
        </condition>
      </change>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Display Panel based on Text Box</title>
      <table depends="$logLevel$">
        <title>When the Search is Waiting for Input</title>
        <search>
          <query>| makeresults
          | eval filterData="$logLevel$"</query>
        </search>
      </table>
      <html rejects="$logLevel$">
        <div style="font-weight:bold;text-align: center;">--</div>
      </html>
    </panel>
  </row>
</form>

 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

knanaiah001
Explorer

@niketn ,Thank you:)
But without submit button is it possible to set --  in panel when dashboard loads (empty text input)?

0 Karma

niketn
Legend

@knanaiah001 this should be available out of the box Documented feature of Simple XML dashboard.

Remove submit button by 

submitButton="false"

And for the text box add

 searchWhenChanged="true"


Following is the required change in the previous code.

  <fieldset submitButton="false" autoRun="false">
    <input type="text" token="logLevel" searchWhenChanged="true">
      <label>Log Level</label>
      <change>
        <condition value="">
          <unset token="form.logLevel"></unset>
        </condition>
      </change>
    </input>
  </fieldset>

 

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If a search contains a token that is not defined then you will always get "Search is waiting for input" until that token is defined.  AFAIK, there is no way to suppress that.

You can, however, hide the panel until the input is selected.  Edit the source of your dashboard and add a depends clause to each panel.

<panel depends="$text token$">
...

Of course, you should replace "text token" with the name of your textbox input token.

---
If this reply helps you, Karma would be appreciated.

knanaiah001
Explorer

Hi @richgalloway ,
Nope,I'am not supposed to hide the panels.
I had attached a image ,which shows  my dashboard layout .
So whenever I refresh the dashboard,i  need panels with "- -" display without even clicking on my input text box .

0 Karma
Get Updates on the Splunk Community!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...