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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...