Getting Data In

Unable to Connect to Linux Splunk Indexer from Windows using SDK Java


Hi Experts,

I am new to Splunk so please bear with me if this is stupid.

I have been doing some tinkering with the Splunk SDK for Java. While I have been successfully able to connect and retrieve data to locally installed Splunk Enterprise in my Windows machine. When I try to do the same for my remote Indexer(Linux box) from my Windows machine, the program fails to connect. The code snippet is as below :

    ServiceArgs connectionArgs = new ServiceArgs();

When I run the above code from Eclipse in Windows, I get the below error :

java.lang.RuntimeException: Connection timed out: connect
at com.splunk.HttpService.send(
at com.splunk.Service.send(
at com.splunk.Service.login(
at com.splunk.Service.login(
at com.splunk.Service.connect(
at com.splunk.examples.spurl.Program.main(
Caused by: Connection timed out: connect
at Method)

Please let me know if this can be fixed, or this is the wrong way to do it. 😞

I have tried with SSLv3,TLSv1.1,TLSv1.2 but nothing works...

Tags (4)

Splunk Employee
Splunk Employee

Have you tried using curl to see if you can successfully hit the endpoint? Is the indexer behind a proxy? Is the REST API enabled?

This page has some things to try:


Thanks for the information.

Actually yes the Indexer is behind a proxy. Also the REST API is enabled.

0 Karma

Splunk Employee
Splunk Employee

OK, I would try curl to see if you can successfully make a request and access the API.

0 Karma