Splunk Dev

Splunk connection refused

1234testtest
Path Finder

This seemingly looks like a simple problem but yet to come out of it.
I have a program which used to just work fine (uses splunk java sdk). Suddenly, it stopped working and giving me - java.net.ConnectException: Connection refused: connect.
I have checked ports are open. This is localhost only.
Pl guide what else could be looked for.

1 Solution

Neeraj_Luthra
Splunk Employee
Splunk Employee

Based on the error, it is not your credentials that are causing this issue. I know that if your server isn't running, you definitely get the same error when trying to connect.

If your server is indeed running, then the next logical step would be to try and connect to the server from the command line using curl (of course change the host, credentials etc.):

curl -k https://localhost:8089/services/auth/login -d username=admin -d password=changeme

View solution in original post

nfrengle
New Member

I got this error when I forgot the port number. Couldn't figure out why I was able to access from one PC but not another one sat side-by-side. Luckily it didn't take me more than 5 minutes to realise my mistake, but saw this window (the post of this question) still open, and thought I would suggest the more likely cause (user error).

0 Karma

Neeraj_Luthra
Splunk Employee
Splunk Employee

Based on the error, it is not your credentials that are causing this issue. I know that if your server isn't running, you definitely get the same error when trying to connect.

If your server is indeed running, then the next logical step would be to try and connect to the server from the command line using curl (of course change the host, credentials etc.):

curl -k https://localhost:8089/services/auth/login -d username=admin -d password=changeme

scottwedeking
New Member

I am trying to connect Splunk using command line. Below is my code as per documentation -

curl --get -k -u scottwedeking:pL6tpMXDXQZuil3y06wN -d "output_
mode=csv" -d "count=5" https://api.nr5b-yk5q.data.splunkstorm.com:8089/servicesN
S/scottwedeking/search/search/jobs/1310082457.10/results
But I am getting this error :

curl: (7) Failed to connect to api.nr5b-yk5q.data.splunkstorm.com port 8089: Con
nection refused

0 Karma

1234testtest
Path Finder

thank you.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...