Is there a way to force splunk to pickup this change?
<dashboard script="custom_viz.js"> <row> <html> <h2>Zone</h2> <div id="custom"></div> </html> </row> </dashboard>
cp custom_viz.js test.js
and change the reference to test.js, nothing renders.
These aren't helping any
http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/views http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/nav http://YOUR_SERVER:8000/en-US/debug/refresh
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.
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.
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
splunk command points to
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 http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?123456
* It opens the content of my screit
* Now,I have modified my code and launched the url http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js?**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 : http://127.0.0.1:800/en-US/static/app/MyApp/src/js/karthi.js? + 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");
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.