Getting Data In

Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC ,SETTING $SPLUNKHOME (LINUX)

lamlam
Engager

Hey guys
I am getting an error on my ubuntu server "Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC :perhaps one should be set in the environment.
I have google the error but I am having a difficult time finding my $SPLUNK_HOME
commands I've tried :

echo $SPLUNK_HOME : nothing shows up

/opt/splunk/bin/splunk envvars : Error message "Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC :perhaps one should be set in the environment"

./splunk status : no such file or directory

/opt/splunk/etc/splunk-launch.conf : bash /opt/splunk/etc/splunk-launch.conf: no such file or directory

Thank you in advance !

Just in case it helps ; splunk was install via tar xvzf splunk-7.1.7-39ea4c097c30-Linux-x86_64.tgz -C /opt

1 Solution

codebuilder
Influencer

Unpacking your tgz file does not set environment variables.

Set SPLUNK_HOME as follows:

export SPLUNK_HOME=/opt/splunk

Ensure all files and directories are owned by splunk (if that's the user you intend to run as):

chown -RP splunk:splunk /opt/splunk

Then start Splunk up for the first time, this will generate initial config files

/opt/splunk/bin/splunk start --accept-license -user splunk

From there you can set values in /opt/splunk/etc/splunk-launch.conf or make your environment variable permanent by adding it to your PATH.

----
An upvote would be appreciated and Accept Solution if it helps!

View solution in original post

ddrillic
Ultra Champion

A similar case at $SPLUNK_HOME not set

It speaks about ./splunk envvars which shows all the environment variables.

mattymo
Splunk Employee
Splunk Employee

TIL. 🙌🏼

- MattyMo
0 Karma

codebuilder
Influencer

Unpacking your tgz file does not set environment variables.

Set SPLUNK_HOME as follows:

export SPLUNK_HOME=/opt/splunk

Ensure all files and directories are owned by splunk (if that's the user you intend to run as):

chown -RP splunk:splunk /opt/splunk

Then start Splunk up for the first time, this will generate initial config files

/opt/splunk/bin/splunk start --accept-license -user splunk

From there you can set values in /opt/splunk/etc/splunk-launch.conf or make your environment variable permanent by adding it to your PATH.

----
An upvote would be appreciated and Accept Solution if it helps!

lamlam
Engager

I've type the first command and got the error message

export SPLUNK_HOME=/opt/splunk

bash: export: '=/opt/splunk' : not a valid identifier

sorry beginner at linux and terminal commands
thank you for your patience !

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...