This is a simple upgrade script for Splunk on Linux x64.
It will download the latest Splunk version, generate a diag then proceed to the upgrade while writing the output to the console as well as in a log file.
To use this script to upgrade a Splunk instance, please consider the prerequisites below.
It is dedicated to Linux x64 tgz.
Wget is used to download Splunk latest version.
As the script uses splunk commands, path to ${PSLUNK_HOME}/bin
must be added.
One can either use :
{
echo "export PS1='\[\033[1;32m\]\$(whoami)@\$(hostname): \[\033[0;37m\]\$(pwd)\$ \[\033[0m\]'"
echo "export SPLUNK_HOME=\"/opt/splunk\""
echo "export PATH=\${SPLUNK_HOME}/bin:\${PATH}"
echo ". \${SPLUNK_HOME}/share/splunk/cli-command-completion.sh"
} >> /etc/bashrc
or refer to: https://docs.splunk.com/Documentation/CoE/ssf/Handbook/UnixProfile#Add_Splunk_to_PATH
The package will be retrieved from splunk.com.
Copy the script to the target system, make it executable and run it.
The output is logged in splunk-simple-upgrade.sh.log
.
A light Splunk diag is generated in /opt/splunk
directory.