Dashboards & Visualizations

Adding javascript without restarting splunk

Path Finder

I'm looking at changing a javascript file on a Splunk6 instance which I can not bounce. I noticed that if I copy the original file to a new one, then reference the new file, it doesn't run.

Is there a way to force splunk to pickup this change?

<dashboard script="custom_viz.js">
            <div id="custom"></div>

If I

cp custom_viz.js test.js

and change the reference to test.js, nothing renders.

These aren't helping any



Super Champion

Note that there are some settings in web.conf that can be helpful when developing an apps or other custom UI stuff, but they be unwanted in a production use-case. You wouldn't want to turn these on then forget about them, as they will impact performance for all users; therefore working from a dedicated "dev" splunk instance is recommended and tweak these settings there.

The good news is that if you don't already have a dedicated search head for app/view testing and development, it's fairly straightforward to setup a fresh search head and simply connect it to your backend indexers or all-in-one single instance. This way you can isolate your "production" users from testing/development changes, and at the same time develop more quickly due to fewer restarts. Even if you have limited server resources, you can launch a second instance of Splunk on the same box, using different ports of course and only run it as-needed. (You will have manage the copying/deployment of changes between instances.)

Resources that explain some more options:

0 Karma


To reload any changes done to existing java script we can bump it and create new version.
Hit following url http://server name:8000/en-US/_bump. It will display page, showing current version and button. Click on the button and then all the java script changes will be applied. However, it may not work if you are adding new file.

0 Karma


I tried the below with the splunk instance in my machine,
* Kept the js file inside "/appserver/static" folder of my application
* launched the url
* It opens the content of my screit
* Now,I have modified my code and launched the url**654321**
* it opens the new content...
* So you don't have to refresh or restart splunk.. Just have to change the url.. you can use Math.random() to do so..

E.G : + Math.random()

... But in your case you should not hard code the JS file path in script tag...
you should add the script tag dynamically and it to head tag......

E.g: jQuery('<script src="/static/app/MyApp/karthi.js?' +Math.random()  + '"/>").appendTo("head");

New Member

it Works... great job..

0 Karma


You have to restart splunkweb in order for new files to be picked up. The good news is that this is much quicker (typically a couple of seconds) than restarting the whole Splunk instance in (splunkweb + splunkd) and does not affect user sessions or running searches. You can restart splunkweb on the command line:

$ splunk restartss


$ splunk restart splunkweb

(The splunk command points to $SPLUNK_HOME/bin/splunk)


@ziegfried, in 6.2 there's no separate splunkweb service anymore. Does that mean I need to do a full Splunk restart to pick up new JS files?

0 Karma

Splunk Employee
Splunk Employee

@cphair, it's still the same command to restart the web UI portion.

0 Karma


try holding down shift or ctrl while hitting the refresh button in your browser.

0 Karma


ah it may require a restart of splunk then, may be non avoidable if it's a new js file that you are adding.

If you were to modify the existing js file, you would not have to restart.

Path Finder

Thanks- but this does not help. I know that the dashboard is trying to find the new js file because it renders the html block empty when I switch the reference to a file that was created. When I switch back it works without issue.

0 Karma
Get Updates on the Splunk Community!

Ready, Set, SOAR: How Utility Apps Can Up Level Your Playbooks!

 WATCH NOW Powering your capabilities has never been so easy with ready-made Splunk® SOAR Utility Apps. Parse ...

DevSecOps: Why You Should Care and How To Get Started

 WATCH NOW In this Tech Talk we will talk about what people mean by DevSecOps and deep dive into the different ...

Introducing Ingest Actions: Filter, Mask, Route, Repeat

WATCH NOW Ingest Actions (IA) is the best new way to easily filter, mask and route your data in Splunk® ...