Dashboards & Visualizations

Global dashboard.js

sboogaar
Path Finder

Is it possible to make a dashboard.js for all pages (global)?
I want to run a specific script that adds a machine id to the header on every page in the splunk environment.
The script works perfectly at the moment for a specific app but im not able to run it on every page.

Tags (1)
0 Karma

saurabh009
Path Finder

You can use a single JavaScript file at the app level. Place a file named dashboard.js in $SPLUNK_HOME/etc/apps/Splunk_app/appserver/static Every dashboard in your app will execute this JavaScript without any modifications to the actual dashboard.
To make changes global you need to make changes here:-
$SPLUNK_HOME/share/splunk/search_mrsparkle/exposed/

Need to be careful when you make changes to global file.

you can find more help here:-
https://docs.splunk.com/Documentation/Splunk/7.2.4/Module/Simplecustomizations

sboogaar
Path Finder

$SPLUNK_HOME/etc/apps/my_app_name/appserver/static is exactly how I have it, but I want it everywhere/global.

0 Karma

sboogaar
Path Finder

@saurabh009 How do you apply changes on a distributed environment?

0 Karma

Vijeta
Influencer

@sboogaar You can refernce the script using script=":.js" in your form or dashboard tag.
For example if your js is in search app and you want to reference in some other app, use this in the other app

 <dashboard script="search:dashboard.js">
0 Karma

sboogaar
Path Finder

I do not want to add it manually to every other dashboard I want to use one everywhere if possible. Else I could also just put it in the static directory of each app.

0 Karma
Get Updates on the Splunk Community!

There's No Place Like Chrome and the Splunk Platform

Watch On DemandMalware. Risky Extensions. Data Exfiltration. End-users are increasingly reliant on browsers to ...

The Great Resilience Quest: 5th Leaderboard Update

The fifth leaderboard update for The Great Resilience Quest is out &gt;&gt; &#x1f3c6; Check out the ...

Devesh Logendran, Splunk, and the Singapore Cyber Conquest

At this year’s Splunk University, I had the privilege of chatting with Devesh Logendran, one of the winners in ...