<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [WinError 10061]  Export data using the Splunk SDKs not working? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/WinError-10061-Export-data-using-the-Splunk-SDKs-not-working/m-p/527779#M9440</link>
    <description>&lt;P&gt;Apologies if these are very basic questions but I am new to the API and the SDK.&amp;nbsp; I am running the script below following the guidelines provided in the documentation, but I am getting the following error.&amp;nbsp; Can anyone point me in the correct direction?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/Search/ExportdatausingSDKs" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/Search/ExportdatausingSDKs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import splunklib.client as client
import splunklib.results as results

HOST =  
PORT = 8089
USERNAME =  
PASSWORD =  


service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD)

rr = results.ResultsReader(service.jobs.export("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)
        string_format="%s:%s"
        print(string_format % data)
    elif isinstance(result, dict):
        # Normal events are returned as dicts
        print(result)
assert rr.is_preview == False
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Nov 2020 16:52:02 GMT</pubDate>
    <dc:creator>CarbonCriterium</dc:creator>
    <dc:date>2020-11-03T16:52:02Z</dc:date>
    <item>
      <title>[WinError 10061]  Export data using the Splunk SDKs not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/WinError-10061-Export-data-using-the-Splunk-SDKs-not-working/m-p/527779#M9440</link>
      <description>&lt;P&gt;Apologies if these are very basic questions but I am new to the API and the SDK.&amp;nbsp; I am running the script below following the guidelines provided in the documentation, but I am getting the following error.&amp;nbsp; Can anyone point me in the correct direction?&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.0/Search/ExportdatausingSDKs" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.0/Search/ExportdatausingSDKs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import splunklib.client as client
import splunklib.results as results

HOST =  
PORT = 8089
USERNAME =  
PASSWORD =  


service = client.connect(
    host=HOST,
    port=PORT,
    username=USERNAME,
    password=PASSWORD)

rr = results.ResultsReader(service.jobs.export("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)
        string_format="%s:%s"
        print(string_format % data)
    elif isinstance(result, dict):
        # Normal events are returned as dicts
        print(result)
assert rr.is_preview == False
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 16:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/WinError-10061-Export-data-using-the-Splunk-SDKs-not-working/m-p/527779#M9440</guid>
      <dc:creator>CarbonCriterium</dc:creator>
      <dc:date>2020-11-03T16:52:02Z</dc:date>
    </item>
  </channel>
</rss>

