Deployment Architecture

Unable to connect to Splunk server via java sdk

andrewpagans
Path Finder

Hi All,

I am trying to connect to Splunk (Search Head) via Java sdk.
But I received connection timeout error: java.lang.RuntimeException: Connection timed out: connect

Code:

HttpService.setSslSecurityProtocol(SSLSecurityProtocol.TLSv1_2);
ServiceArgs serviceArgs = new ServiceArgs();
serviceArgs.setHost("companysplunkSearchHead.net");  // without http
serviceArgs.setPort(8089);
serviceArgs.setUsername("user");
serviceArgs.setPassword("password");

Service service = Service.connect(serviceArgs);

The Splunk instance is on OpenShift ( I tried also to: create a new route for the port 8089 and also set allowRemoteLogin=always)
But the problem of connectivity still persists.

The same code works in local.

Could you please help me?

Thanks 🙂

adit
Engager

I hope u resolved the issue,

I am also facing the same issue, could you please help.

0 Karma

anantcd
Explorer

This means your request did not get a response within some (default) timeframe. The reasons that no response was received is likely to be one of:

  1. The IP/Hostname or port is incorrect
  2. The IP/Hostname or port (i.e service) is down
  3. The IP/Hostname is taking longer than your default timeout to respond
  4. You have a firewall that is blocking requests or responses on whatever port you are using
  5. You have a firewall that is blocking requests to that particular host
  6. Your internet access is down
  7. Your live-server is down i.e in case of "rest-API call".

Also, if you're trying to connect insecurely to an endpoint, set the scheme to "http":

serviceArgs.setScheme("http");
0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...