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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...