Dashboards & Visualizations

How to restrict a dashboard panel to stop executing when a wild card or asterisk is given in the input field ?

pavanae
Builder

I have a Splunk dashboard as follows with some input fields. 

pavanae_1-1643676281896.png

Now As you can see above by default the input value for host column is wild card * . Now, If I click the checkbox "show" under Latency validation check it will display a panel below it. 

Now, as a good practice how do I disable executing the search when some one used the wild card in host input as the input will be used as a token for the search. 

I mean only when a valid hostname is given as an input for Host the search should execute for the Latency Validation check. 

Note :-

Here I need the wild card as a default entry for host input as there are some other panels which uses that wild card but I only wanted to restrict the use of wild card to only one particular panel. 

 

Code can be found below :- 

 

 

 

<input type="text" token="host">
      <label>Host</label>
      <default>*</default>
    </input>
    <input type="checkbox" token="overview">
      <label>Latency Validation Check</label>
      <choice value="true">Show</choice>
      <change>
        <condition label="Show">
          <set token="overview">true</set>
        </condition>
      </change>
    </input>

 

 

 

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

Update the token for host filter to "host_temp".

Use similar <change> for host input and use <condition> and with <eval> check if the value contains * (wildcard) or not.

If it does not contain a wildcard set a new token "host".

If it contains wildcard unset the token "host".

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

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

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...