I am working on a script for running Splunk.
I want to check status of Splunk and assign the result of the status to a variable for further use.
Can any one please help me with this?
You can run following command and capture the output in a variable.
Shell script example
status=$($SPLUNK_HOME/bin/splunk status | grep not | wc -l )
If status=0, Splunk is up, down otherwise (1). Replace $SPLUNK_HOME with your installation path.
View solution in original post
Thanks for your reply. it is working