Splunk Search

Is it possible to add "starting the search" to the link switcher option?

HeinzWaescher
Motivator

Hi,

I would like to implement some options to show/hide panels in a dashbaord.
Currently the plan to have an option for each panel at the top of the dashboard, so that Splunk users can decide what they want to see.

< input type="checkbox" token="panel_1" searchWhenChanged="true">
         <label>Overview</label>
         <choice value="true">Show</choice>
         <change>
           <condition label="Show">
             <set token="panel_1">true</set>
           </condition>
         </change>
         <default>true</default>
       </input>

 < panel depends="$panel_1$">

As far as I understand this, Splunk is running ALL searches when I open the dashboard, no matter what is selected in this option. Is it possible to only start the search of a panel, when the user selects the show option? This would reduce loading times and load caused by the dashboard.

Thanks in advance

0 Karma
1 Solution

493669
Super Champion

Hi @HeinzWaescher,
Basically your search meeting the token criteria before your depends clause.
so In you panel query add your token in eval statement so that it will wait for input and not run the query until depends token is set.
try this:

< input type="checkbox" token="panel_1" searchWhenChanged="true">
          <label>Overview</label>
          <choice value="true">Show</choice>
          <change>
            <condition label="Show">
              <set token="panel_1">true</set>
            </condition>
          </change>
          <default>true</default>
        </input>
  < panel depends="$panel_1$">
:
:
<query> index=<indexname>|eval temp="$panel_1$"|...remaining query|table <required fields></query>

View solution in original post

493669
Super Champion

Hi @HeinzWaescher,
Basically your search meeting the token criteria before your depends clause.
so In you panel query add your token in eval statement so that it will wait for input and not run the query until depends token is set.
try this:

< input type="checkbox" token="panel_1" searchWhenChanged="true">
          <label>Overview</label>
          <choice value="true">Show</choice>
          <change>
            <condition label="Show">
              <set token="panel_1">true</set>
            </condition>
          </change>
          <default>true</default>
        </input>
  < panel depends="$panel_1$">
:
:
<query> index=<indexname>|eval temp="$panel_1$"|...remaining query|table <required fields></query>

HeinzWaescher
Motivator

Very nice approach to add a "useless" token into the search query 🙂 That solves my issue, thanks a lot!

0 Karma

493669
Super Champion

glad to help 🙂

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...