Splunk Dev

$SPLUNK_HOME not set

nawazns5038
Builder

I observed is that $SPLUNK_HOME is not set on the splunk-launch.conf file on the search heads . Is that a problem ??

0 Karma

ddrillic
Ultra Champion

Looking at a production search head of ours at /opt/splunk/etc/splunk-launch.conf and it starts with -

#   Version 6.2.2

# Modify the following line to suit the location of your Splunk install.
# If unset, Splunk will use the parent of the directory this configuration
# file was found in
#
# SPLUNK_HOME=/home/build/build-home/6.2.2

Which means that $SPLUNK_HOME would be set by the software to /opt/splunk. So, apparently we don't need to do a thing ; -)

It's interesting that when running $ set at the command line, no SPLUNK variables show up.

nawazns5038
Builder

Yes, I can't see the output of echo $SPLUNK_HOME as well.

0 Karma

ddrillic
Ultra Champion

As @MuS said at Where is splunk installed on Linux?

/opt/splunk/bin/splunk envvars

Shows it. I see -

... SPLUNK_HOME=/opt/splunk ; export SPLUNK_HOME  ...
0 Karma

nawazns5038
Builder

Ya, can be seen in through the command

/opt/splunk/bin/splunk envvars

richgalloway
SplunkTrust
SplunkTrust

If $SPLUNK_HOME is not set, the default value will be used. Are you experiencing a problem?

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

nawazns5038
Builder

no errors for now. Just curious as I don't see the output of echo $SPLUNK_HOME as well.

0 Karma

quinneyc
Engager

If you want to be able to see it then you could always just type the following on the cmd line:
export SPLUNK_HOME=/opt/splunk 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

One nice feature is shell completion. You could start it by 

  • will be packaged with future (after 6.x) releases of Splunk; it will be found in SPLUNK_HOME/bin/ directory; further, the SPLUNK_HOME/bin/setSplunkEnv util will run this script, and confirm success with the message   Tab-completion of "splunk <verb> <object>" is available.

More on https://community.splunk.com/t5/Deployment-Architecture/CLI-command-completion-Yes-and-here-s-how-Fo... and somewhere in docs, but I can’t found it now.

Sourcing above to shell also se $SPLUNK_HOME

r. Ismo

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You don't see it because it's not set in your environment. It's in Splunk's environment, however.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Get Schooled with Splunk Education: Explore Our Latest Courses

At Splunk Education, we’re dedicated to providing incredible learning experiences that cater to every skill ...

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...