Dashboards & Visualizations

prevent dashboard from running searches when it is loaded

imrago
Contributor

Is it possible to prevent a dashboard to autorun all the searches in it when the dashboard is opened? Ideally the searches should run only when the user had selected all the desired parameters in the fields and Submit is pressed.

0 Karma
1 Solution

to4kawa
Ultra Champion
<form>
  <label>circle</label>
  <fieldset submitButton="true">
    <input type="checkbox" token="field1">
      <label>auto run</label>
      <choice value="2">2</choice>
    </input>
  </fieldset>
  <row>
    <panel depends="$alwaysHideCSS$">
      <html>
         <style>
           #chartPanel{
             width:500px !important;
           }
         </style>
       </html>
    </panel>
  </row>
  <row>
    <panel id="chartPanel">
      <chart>
        <search>
          <query>| makeresults count=$field1$
| streamstats count
| eval x=if(count=1,-1.100,1.100) 
| makecontinuous span=0.001 x
| dedup x
| eval y = exact(sqrt(1 - pow(x,2)))
| eval y = if(abs(x) <= 1,y,NULL)
| eval yy = -y
| table x y yy</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.legend.placement">none</option>
        <option name="charting.fieldColors">{y:#000000, yy:#000000}</option>
        <option name="height">550</option>
      </chart>
    </panel>
  </row>
</form>

Hi, @imrago
This is an example.
If you pass the token to the search and click the submit button, basically it will not be executed automatically.

View solution in original post

0 Karma

to4kawa
Ultra Champion
<form>
  <label>circle</label>
  <fieldset submitButton="true">
    <input type="checkbox" token="field1">
      <label>auto run</label>
      <choice value="2">2</choice>
    </input>
  </fieldset>
  <row>
    <panel depends="$alwaysHideCSS$">
      <html>
         <style>
           #chartPanel{
             width:500px !important;
           }
         </style>
       </html>
    </panel>
  </row>
  <row>
    <panel id="chartPanel">
      <chart>
        <search>
          <query>| makeresults count=$field1$
| streamstats count
| eval x=if(count=1,-1.100,1.100) 
| makecontinuous span=0.001 x
| dedup x
| eval y = exact(sqrt(1 - pow(x,2)))
| eval y = if(abs(x) <= 1,y,NULL)
| eval yy = -y
| table x y yy</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.legend.placement">none</option>
        <option name="charting.fieldColors">{y:#000000, yy:#000000}</option>
        <option name="height">550</option>
      </chart>
    </panel>
  </row>
</form>

Hi, @imrago
This is an example.
If you pass the token to the search and click the submit button, basically it will not be executed automatically.

0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...