Splunk Dev

how to pass a token value= "*" on button/link click on dashboard

DataOrg
Builder

i want to set token  value ="*" on button click/link click on the dashboard.

is it possible to achieve without JS?

@kamlesh_vaghela  any inputs pls? 

Labels (1)
Tags (3)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hello @DataOrg ,

If the button is from Simple XML then you can set token in xml only but in case of HTML button or any element you have to go with Splunk JS Extension only.  🙂

0 Karma

DataOrg
Builder

@kamlesh_vaghela Good Day.

I had tried with JS and HTML button but token gets reset but table is not refreshing.

<button type="button" id="buttonId" class="btn">Reset</button>
require([
        'jquery',
        'splunkjs/mvc',
        'splunkjs/mvc/simplexml/ready!'
    ], function ($, mvc) {
    var tokens = mvc.Components.get("default");
    $('#buttonId').on("click", function (e){
       tokens.set("SELECTED_PU", "*");
		tokens.set("SELECTED_PL", "*"); 
    });
});
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...