Monitoring Splunk

Splunk start does not work with -user Username; how do I run Splunk as a particular user?

jsmith39
Path Finder

I'm trying to start Splunk on an initial install as a user other than root (splrun).
I create the user account, set a password, and then installed but did not start Splunk as root
and then took the following steps
chown -R splrun:splrun /opt/splunk
/opt/splunk/bin/splunk enable boot-start --accept-license -user splrun
/opt/splunk/bin/splunk start -user splrun .... this failed with a permissions error so I reran chown -R... from above, then reran ..start -user splrun

At this point the webservice (8000) started but the management service (8089) states
"Starting splunk server daemon (splunkd)... Bad Option -u"
then eventually states "Timed out waiting for splunkd to start. [FAILED]"

Running ..splunk status shows
splunkd is not running.
splunkweb is running (PID: 9044).

I appreciate any help in learning how to start Splunk as a non-root user.
Thanks!

Tags (2)
0 Karma
1 Solution

jrodman
Splunk Employee
Splunk Employee

We have no -user flag on 'splunk start'.

Try 'splunk help start'.

In order to run splunk as a particular user:

  • log in as that user and run splunk start

OR

  • Ensure SPLUNK_OS_USER in etc/splunk-launch.conf is your desired user, and then start it via init script or directly as that user or as root

View solution in original post

jsmith39
Path Finder

Thank you for the insight.

Followup question.
I create a user named splrun on the client machine prior to installing Splunk Enterprise via script.
This fails during installation with permission denied issues during the installation.
What is the correct method of prepping the delivery location to avoid this problem.

Thank You.

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

after enabling boot-start with -user, you should not use splunk start to start splunk. Instead, you need to use service splunk start. The boot-start installs a startup service that runs as the non-root user. There is no -user option on splunk start.

esix_splunk
Splunk Employee
Splunk Employee

You will need to configure the boot-start user for splunk.

$splunk_home/bin/splunk enable boot-start -user userIwantSplunktoRunAS
e.g. As root: $ /opt/splunk/bin/splunk enable boot-start -user splunkdaemon

That tell splunk which user to run as when the system starts splunk. Not that when you try and start splunk, you need to su or be logged in as that user. If you run it as root, or a different user, it will wreak havoc on your splunk install by resetting permissions and other potentially destructive things.

jrodman
Splunk Employee
Splunk Employee

We have no -user flag on 'splunk start'.

Try 'splunk help start'.

In order to run splunk as a particular user:

  • log in as that user and run splunk start

OR

  • Ensure SPLUNK_OS_USER in etc/splunk-launch.conf is your desired user, and then start it via init script or directly as that user or as root
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...