Splunk Enterprise

How to make JavaScript applicable to all dashboards?

cuongnguyen112
Engager

Hi, I have a javascript file and I want it to be applicable to all dashboards

Are there any way to do that but not copy and paste the reference to each  html file ?

Thanks.

Labels (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@cuongnguyen112 

You can use dashboard.js to apply common logic in all dashboard.

`dashboard.js` is internally executed by The Splunk web  when any dashboard gets loaded.

You can create dashboard.js in YOUR_APP/appserver/static folder and  open any dashboard in that app.

require([
    'underscore',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
], function(_, mvc) {
    console.log("Kamlesh")
});

 

I hope this will help you to move you on 🙂 .

KV

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 ...