Dashboards & Visualizations

refresh default.xml via script?

DTERM
Contributor

Has anyone had any luck in scripting the following?

http://YOUR_SERVER:8000/en-US/debug/refresh?entity=/data/ui/nav

If you put that in a web browser, it will reload changes to default.xml. I need to automate this via shell script. I tried wget and lynx with no luck.

Anyone out there successfully script the reload?

Tags (1)
0 Karma
1 Solution

Drainy
Champion

Well if you want to make a scripted input set on an interval to reload them you can use python to do something like;

import splunk.rest
sessionKey = sys.stdin.read().strip()
splunk.rest.simpleRequest("/servicesNS/nobody/APPNAME/data/ui/views/_reload", sessionKey = sessionKey)

Edit it to match what you wish to reload and the appname
then in inputs.conf just add the line;

passAuth = admin

To the stanza for the scripted input. Set the interval to whatever you want. But what is the use-case for this? if you explain in a bit more detail there might be a more suitable answer

Also, just wgetting that won't work as it requires a session, the other way I've done this before is to load it into the application.js for the app so as a user is viewing an app its reloading the cache in the background.

View solution in original post

0 Karma

Drainy
Champion

Well if you want to make a scripted input set on an interval to reload them you can use python to do something like;

import splunk.rest
sessionKey = sys.stdin.read().strip()
splunk.rest.simpleRequest("/servicesNS/nobody/APPNAME/data/ui/views/_reload", sessionKey = sessionKey)

Edit it to match what you wish to reload and the appname
then in inputs.conf just add the line;

passAuth = admin

To the stanza for the scripted input. Set the interval to whatever you want. But what is the use-case for this? if you explain in a bit more detail there might be a more suitable answer

Also, just wgetting that won't work as it requires a session, the other way I've done this before is to load it into the application.js for the app so as a user is viewing an app its reloading the cache in the background.

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...