Developing for Splunk Enterprise

Does the Python SDK work with Splunk Cloud?

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

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

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

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

Path Finder

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

0 Karma

Champion

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

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!