Splunk Dev

How to resolve error when trying to run a query on localhost using Splunk SDKs: "ConnectionRefusedError"?

Arpit_S
Path Finder

Hi,

I am getting below error when trying to run query using splunk SDKs,

python "C:\......\splunk-sdk-python-1.6.6\splunk-sdk-python-1.6.6\examples\search.py" "search index=_internal | stats count by node_type"

  File "C:\Program Files (x86)\Python\lib\http\client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 1016, in _send_output
    self.send(msg)
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 956, in send
    self.connect()
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 1384, in connect
    super().connect()
  File "C:\Program Files (x86)\Python\lib\http\client.py", line 928, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "C:\Program Files (x86)\Python\lib\socket.py", line 727, in create_connection
    raise err
  File "C:\Program Files (x86)\Python\lib\socket.py", line 716, in create_connection
    sock.connect(sa)

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

Any idea what is going wrong here?
Are there any prerequisites to use SDKs?

Thanks & Regards.

Labels (1)
0 Karma

ganapathymanian
Loves-to-Learn Lots

Did anyone fixed this error?
I am facing same issue...

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...