Dashboards & Visualizations

Create Submit Button in XML to run the search?

chitreshakumar
Communicator

I have 6 multi-select input in my dashboard .Whenever I select one of the values the search starts running but I want a"Submit" button to control the search so that my tables and graphs load after I click on the submit button ??

0 Karma
1 Solution

hardikJsheth
Motivator

Set autoRun parameter to false as follows :

<fieldset autoRun="false" submitButton="true">

View solution in original post

harsmarvania57
Ultra Champion

You need to enable submit button and disable searchWhenChanged

Like this

  <fieldset submitButton="true" autoRun="false">
    <input type="multiselect" token="field1" searchWhenChanged="false">

chitreshakumar
Communicator

Can you elaborate since I think this is what I want?

0 Karma

harsmarvania57
Ultra Champion

First line enable Submit button based on code submitButton="true" and secondline is MultiSelect input with token as field1 but searchWhenChanged="false" this code will disable execution of search query when you select, deselect Multiselect input means you can do N number of selection and query will not execute while doing selection, query will execute only when you will click Submit button.

I hope this helps.

0 Karma

chitreshakumar
Communicator

One more thing I have 6 input but I need only one submit button do I need to add
<fieldset submitButton="true" autoRun="false">
before each input or only once before the start of the input in the panel??

0 Karma

harsmarvania57
Ultra Champion

<fieldset submitButton="true" autoRun="false"> will be used only once in Dashboard.

Please see sample dashboard XML with 2 multiselect input

<form>
  <label>test</label>
  <fieldset submitButton="true" autoRun="false">
    <input type="multiselect" token="field1" searchWhenChanged="false">
      <label>field1</label>
      <choice value="sourcetype">Sourcetype</choice>
      <search>
        <query/>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </search>
      <delimiter> </delimiter>
    </input>
    <input type="multiselect" token="field2" searchWhenChanged="false">
      <label>field2</label>
      <choice value="host">Host</choice>
      <delimiter> </delimiter>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <search>
          <query>index=_internal | stats count by $field1$, $field2$</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
        </search>
      </table>
    </panel>
  </row>
</form>
0 Karma

hardikJsheth
Motivator

Set autoRun parameter to false as follows :

<fieldset autoRun="false" submitButton="true">

chitreshakumar
Communicator

Can you elaborate as I am new to this??

0 Karma

Padma12345
Explorer

thanks a lot

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...