Building for the Splunk Platform

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

Path Finder


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 index=_internal | stats count by node_type"

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

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

Loves-to-Learn Lots

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

0 Karma
Get Updates on the Splunk Community!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...