Splunk Dev

Does the Python SDK work with Splunk Cloud?

fdarrigo
Path Finder

I am trying to run the SDK examples in Python, but I cannot connect to SplunkCloud instance.
Specifically, I am running splunk-sdk-python\examples\abc\a.py with the following changes:

HOST="<myinstance>.splunkcloud.com"
PORT = 8089
USERNAME = "myusername"
PASSWORD = "mypassword"

I am receiving the following errors:

Traceback (most recent call last):
  File "C:\Python27\Lib\splunk-sdk-python-master\examples\abc\a.py", line 38, in <module>
    connection.request("POST", "/services/auth/login", body, headers)
  File "C:\Python27\lib\httplib.py", line 1053, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 1093, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 1049, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 893, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 855, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 1266, in connect
    HTTPConnection.connect(self)
  File "C:\Python27\lib\httplib.py", line 832, in connect
    self.timeout, self.source_address)
  File "C:\Python27\lib\socket.py", line 575, in create_connection
    raise err
****error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond****

I confirmed the management port is 8089 and I know the credentials are correct.

Any help would be greatly appreciated.
Frank

0 Karma
1 Solution

andrewb_splunk
Splunk Employee
Splunk Employee

In Splunk Cloud, that port is blocked by default. Contact customer support to request that they unblock the port for you.

View solution in original post

tpavlik_splunk
Splunk Employee
Splunk Employee

You can have the port opened and have a dedicated user with credentials created by requesting through the Splunk Support Portal, here is more information: https://docs.splunk.com/Documentation/Splunk/8.0.5/RESTTUT/RESTandCloud. The devinfo@splunk.com mailing list is unable to assist with those requests, unfortunately.

0 Karma

andrewb_splunk
Splunk Employee
Splunk Employee

In Splunk Cloud, that port is blocked by default. Contact customer support to request that they unblock the port for you.

thellmann
Splunk Employee
Splunk Employee

Documentation on these limitations can be found here: https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTTUT/RESTandCloud

And in case you haven't done this before, the link to file a case with Splunk Support can be found here: https://splunkcommunities.force.com/customers/home/home.jsp

0 Karma

fdarrigo
Path Finder

Thanks. It turns out that opening the port has fixed my problem. I appreciate the speedy response.

0 Karma

bmacias84
Champion

contact devinfo@splunk.com they normally get back to you in 24hrs.

0 Karma

thellmann
Splunk Employee
Splunk Employee

Actually, you'll need to file a case with Splunk Support using the Support portal. You can learn more on this page: https://docs.splunk.com/Documentation/SplunkCloud/latest/RESTTUT/RESTandCloud

Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...