What I use to refresh or reload an app is a python script on the command line. It could obviously be tweaked to be automated using stored credentials, but for my purposes, I only use when developing to update when I make changes.
Here's the script in it's entirety:
import sys
import splunklib.client as client
import getpass
splunkServer = raw_input('Enter the splunk server: ')
splunkAdmin = raw_input('Enter Splunk Admin: ')
splunkPassword = getpass.getpass('Enter Splunk Password: ')
splunkDestApp = raw_input('Enter target App Context: ')
if splunkDestApp:
splunkService = client.connect(host=splunkServer, port=8089, username=splunkAdmin, password=splunkPassword, app=splunkDestApp)
else:
splunkService = client.connect(host=splunkServer, port=8089, username=splunkAdmin, password=splunkPassword)
print('Refreshing app entity...')
applications = splunkService.apps
for app in applications:
if splunkDestApp:
if app.name == splunkDestApp:
try:
#app.refresh()
app.reload()
print(splunkDestApp+' has been refreshed')
except EntityDeletedException:
print('Application '+splunkDestApp+' does not exist.')
The gist is, it prompts for the server and credentials and then which app is to be reloaded. I run it using:
>splunk cmd python scriptname.py
... View more