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!

Leveraging Detections from the Splunk Threat Research Team & Cisco Talos

  Now On Demand  Stay ahead of today’s evolving threats with the combined power of the Splunk Threat Research ...

New in Splunk Observability Cloud: Automated Archiving for Unused Metrics

Automated Archival is a new capability within Metrics Management; which is a robust usage & cost optimization ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...