Deployment Architecture

Script to reload serverclasses that use a specified deployment-app

Path Finder

It's inconvenient that a Splunk deployment-server cannot reload an 'app'. It only reloads a 'serverclass'. Here's a shortcut.

The following bash script takes the name of a deployment-app as a parameter. It will reload serverclasses that use the deployment-app. Copy the script to your Deployment Server to make it easier to push out app changes to clients from the CLI.


if [ $# -lt 1 ]; then
  echo 1>&2 "$0: not enough arguments"
  exit 2
elif [ $# -gt 1 ]; then
  echo 1>&2 "$0: too many arguments"
  exit 2
elif (! (grep -E -q "^\[serverClass:[^:]*:app:$1" /opt/splunk/etc/system/local/serverclass.conf )); then
  echo 1>&2 "$0: No serverclasses found for $1"
  exit 0

grep -E "^\[serverClass:[^:]*:app:$1" /opt/splunk/etc/system/local/serverclass.conf | cut -d':' -f2 | sed -E 's/^(.*)$/ -class \1/g' | tr -d '\n' | xargs echo sudo -H -u splunkserviceaccount /opt/splunk/bin/splunk reload deploy-server -auth admin:changeme

read -p "Press [Enter] to execute above command..."

grep -E "^\[serverClass:[^:]*:app:$1" /opt/splunk/etc/system/local/serverclass.conf | cut -d':' -f2 | sed -E 's/^(.*)$/ -class \1/g' | tr -d '\n' | xargs sudo -H -u splunkserviceaccount /opt/splunk/bin/splunk reload deploy-server -auth admin:changeme
Get Updates on the Splunk Community!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out >> As our brave ...