Deployment Architecture

Can the DB Connect Java_home variable use wildcards in the path?

mcronkrite
Splunk Employee
Splunk Employee

According to the documentation here http://docs.splunk.com/Documentation/DBX/1.1.5/DeployDBX/Installtheconnector
the JAVA_HOME path needs to be set, like this echo $JAVA_HOME to see the path, such as, "/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre"

But having recently upgraded JAVA due to standard patching, my new path was "/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71-2.5.3.1.el7_0.x86_64/jre”

Is there any way to add a wildcard path in the config for the attribute home, located at $SPLUNK_HOME/etc/apps/dbx/local/java.conf?

[java]
home = JAVA_HOME path

0 Karma

bishopolis
Path Finder

To reiterate what @martin_mueller said:

  • typically NO path statement takes wildcards
  • typically you'll need a symlink to point to the correct one
  • you're on Enterprise Linux: you'll have the links managed for you when you install the proper package,
  • your JAVA_HOME is just /usr/lib/jvm/jre and it never changes

so, simply

install -m755 <(echo export JAVA_HOME=/usr/lib/jvm/jre) /etc/profile.d/javahome.sh

.. and you're done.

Extra credit: add that into the RPM you use to pull in the JRE, but remember that we don't have a yum repo yet so don't link in db-connect as a dependency if you do.

(Check out https://answers.splunk.com/answers/33933 for the trivial repo question; it shouldn't be long, now)

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

The usual way is to have a symlink that points to whatever your current java versioned directory is, and have that symlink path in the JAVA_HOME variable. When you update java you update the symlink when finished.

Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...