Dashboards & Visualizations

module name tag error

surekhasplunk
Communicator

Here am getting 2 validation warnings for line 3 .

I want to create custom buttons in my dashoard . how to do that

Tags (2)
0 Karma

niketn
Legend

@surekhasplunk, you are trying to use module and param which have been deprecated long time back from development point of view. You can use Simple XML Dashboard with HTML panel to introduce your own HTML contents like Button and then use JavaScript Extension to code the button functionality and perform actions using Splunk JS Stack. Following is a simple example:

Dashboard Simple XML code:

<dashboard script="hello_world_click.js">
  <label>Submit Button Simple XML JS Extension</label>
  <row>
    <panel>
      <html>
        <a id="myHelloButton" class="btn submit-btn">Submit</a>
      </html>
    </panel>
  </row>
</dashboard>

JavaScript Extension code from hello_world_click.js

require([
    "splunkjs/mvc/simplexml/ready!"
], function() {

    $('#myHelloButton').on("click",function(){
        alert("Hello World");
        console.log("Hello World Console Log");
    });
});

You would need to place the JavaScript code under your Splunk Apps appserver/static folder i.e. $SPLUNK_HOME/etc/apps/<YourAppName>/appserver/static$
Since this requires static files, you may have to restart/refresh/bump your Splunk instance and clear internet browser history if required.

You can get several examples of Simple XML JS Extension from Splunk Dashboard Examples App from Splunkbase: https://splunkbase.splunk.com/app/1603/

You can also explore dev.splunk.com for Splunk Web Framework related examples which covers Simple XML JS Extension and Splunk JS Stack.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...