Dashboards & Visualizations

How to use submitOnDashboardLoad option in normal xml splunk dashboard?

rishav
Explorer

I'm not able to figure out how to use submitOnDashboardLoad in the normal xml dashboard. Where shall I put it. I've tried putting it in the form, search, fieldset, and as option name but its not working.

Labels (1)
0 Karma
1 Solution

rishav
Explorer

putting autorun=true works for me

e.g <input type=drop-down submit=true autorun=true>

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@rishav 

In Splunk Dashboard Studio submitOnDashboardLoad will be used with the Layout option and Submit button.

Please refer below link for Splunk Dashboard Studio submitOnDashboardLoad.

https://docs.splunk.com/Documentation/Splunk/9.0.4/DashStudio/dashDef#Use_layout_options_to_modify_y...

https://docs.splunk.com/Documentation/Splunk/9.0.4/DashStudio/inputConfig#Add_a_submit_button

If you want similar behavior in Simple XML Dashboard then you should go with the below options.

1) For setting up default token values then use the <init> tag. Refer to the below links

2) For setting up tokens from the output of SPL then you need to <search> tag.

 <search>
    <query>| makeresults count=1 
| eval value="Test" </query>
    <done>
      <condition match="$job.doneProgress$=1">
        <set token="value">$result.value$</set>
      </condition>
    </done>
  </search>

Example:

require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc) {
    console.log("LAZY!!!");
    var defaultTokenModel = mvc.Components.get('default');
    var submittedTokenModel = mvc.Components.get("submitted");
    $(document).ready(function() {
        $('input#submitbutton').click(function() {
            //Setting up the token OR execute your logic 
            defaultTokenModel.set("dummy", 1);
            //Update the submit model
            submittedTokenModel.set(defaultTokenModel.toJSON());
        });
    });
});

 


I hope these few tips will help you.

Thanks
KV
If any of my replies help you to solve the problem Or gain knowledge, an upvote would be appreciated.

 

rishav
Explorer

putting autorun=true works for me

e.g <input type=drop-down submit=true autorun=true>

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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