Building for the Splunk Platform

[WinError 10061] Export data using the Splunk SDKs not working?

Path Finder

Apologies if these are very basic questions but I am new to the API and the SDK.  I am running the script below following the guidelines provided in the documentation, but I am getting the following error.  Can anyone point me in the correct direction?

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



import splunklib.client as client
import splunklib.results as results

HOST =  
PORT = 8089

service = client.connect(

rr = results.ResultsReader("search index=_internal earliest=-1h | head 5"))

for result in rr:
    if isinstance(result, results.Message):
        # Diagnostic messages might be returned in the results
        data=(result.type, result.message)
        print(string_format % data)
    elif isinstance(result, dict):
        # Normal events are returned as dicts
assert rr.is_preview == False



Labels (3)
0 Karma
Get Updates on the Splunk Community!

Admin Your Splunk Cloud, Your Way

Join us to maximize different techniques to best tune Splunk Cloud. In this Tech Enablement, you will get ...

Cloud Platform | Discontinuing support for TLS version 1.0 and 1.1

Overview Transport Layer Security (TLS) is a security communications protocol that lets two computers, ...

New Customer Testimonials

Enterprises of all sizes and across different industries are accelerating cloud adoption by migrating ...