Splunk Search

Why do I get "-bash: splunk: command not found" when I try to run the "splunk enable boot-start -user splunk" command?

dharveynswccd
Path Finder

I log in to my Indexer as root, cd to /etc/init.d and then ran the "splunk enable boot-start -user splunk" command. At this point I received the error: "-bash: splunk: command not found".
There are a total of 7 servers in my deployment. When I run the same command on three of the other servers I received the following:
"Init script installed at /etc/init.d/splunk.
Init script is configured to run at boot"

I am not sure what the missing link is here. I will appreciate any assist on this.

Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Your PATH is different on the one server reporting "command not found". Add ":/opt/splunk/bin" to your PATH and it should work.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Your PATH is different on the one server reporting "command not found". Add ":/opt/splunk/bin" to your PATH and it should work.

---
If this reply helps you, Karma would be appreciated.

dharveynswccd
Path Finder

That was spot on. Resolved the issue right away

0 Karma

skoelpin
SplunkTrust
SplunkTrust

If your in the /opt/splunk/bin dir already then you have to do this

./splunk enable boot-start -user splunk

If not then you can do this

/opt/splunk/bin/splunk enable boot-start -user splunk

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...