Splunk environment helper for Macs Version 1.3
Fixes in 1.1 fixed svm started, used to break if - or . was in the Splunk instance name
Features new in 1.2 svm stop-all stop all running Splunk instances svm stop-others stop all running Splunk instances except the current select Splunk instance
Features new in 1.3 svm restart-all restarts all splunk instances svm rebase resets SPLUNK_BASE to the current directory svm cmd-all runs cmd in all splunk instances svm cmd-started runs cmd in running splunk instances tab completion semi-fixes (still some TODO)
Features new in 1.4 svm install|create <instance_name> install a new Splunk instance from package file (see SPLUNK_SOFTWARE & SPLUNK_VERSION in bashrc file) - uses new port numbers if required svm stop stop current Splunk instance svm restart restarts current Splunk instance svm remove removes current Splunk instance svm clean kills all running splunkd and python processes (perhaps a bit aggressive for Python!)
Changed features in 1.4 svm open starts Splunk instance if not already started svm list adds a 'Running' column to indicate running state of Splunk instances svm <instance_name> changes directory to $SPLUNK_HOME fixed autocompletion rules
Setup instructions are in the top of the bashrc file
======= Splunk Version Manager
svm is a command that allows you to switch between different splunks in your terminal.
Additionally, the included bashrc will enhance your prompt to show the currently selected splunk and the splunkd ports of all running splunk instances under SPLUNK_BASE.
svm supplies a set of bash functions. Edit the included bashrc to specify the location where your Splunks are located (SPLUNK_BASE), and to specify a default Splunk (SPLUNK_DEFAULT).
svm assumes that your splunks are installed in different folders under the SPLUNK_BASE folder.
Include the bashrc in your ~/.bashrc
source /path/to/svm/bashrc
On Mac OSX you may not have a default bashrc, in which case, create the bashrc as above, then place the following in your ~/.bash_profile
[[ -s ~/.bashrc ]] && source ~/.bashrc
Switching to the my-test-splunk install: svm my-test-splunk
- svm list - shows all splunk instances and their versions and ports
- svm started - shows all currently running splunk instances
- svm latest - show the latest version of splunk available from splunk.com
- svm open - open the default web browser to the currently selected splunk instance
- svm rebase - change SPLUNK_BASE to be the current directory
- svm home - changes directory to the SPLUNK_HOME of the currently selected instance.
- svm cmd-all - runs the specified command in the context of each splunk
- svm cmd-started - runs the specified command in the context of each running splunk
- svm stop-all - stops all splunks
- svm stop-others - stops all splunks other than the currently selected instance