Splunk Dev

How to get Splunk port using Splunk Java SDK?

kinjalmistry
Explorer

Is there any way to find out the port on which Splunk is set up programmatically using Splunk Java SDK? Basically to read the entry from $SPLUNK_HOME/etc/system/local/web.conf?

Labels (1)
0 Karma
1 Solution

s2_splunk
Splunk Employee
Splunk Employee

The Java SDK has a class named "Settings" with methods to retrieve host and port values, among other settings.

Or use REST directly, as Rich said. Many ways to skin a cat. 🙂

View solution in original post

s2_splunk
Splunk Employee
Splunk Employee

The Java SDK has a class named "Settings" with methods to retrieve host and port values, among other settings.

Or use REST directly, as Rich said. Many ways to skin a cat. 🙂

richgalloway
SplunkTrust
SplunkTrust

Use the SDK to send the REST command /services/configs/conf-web

---
If this reply helps you, Karma would be appreciated.
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, ...