Splunk Dev

Splunk SDK for Python: Why the error Timeout error [Errno 60] Operation timed out?

Haydar
New Member

Hi there everyone, I'm a fresh beginner at Splunk SDK, was exploring stuff and tried to add a user using the library and the below code and it ended up with the error at the bottom. 

 

import splunklib.client as client

HOST = HOST
PORT = 8089
BEARER_TOKEN =BEARER_TOKEN

# Create a Service instance and log in
try:
service = client.connect(
host=HOST,
port=PORT,
splunkToken=BEARER_TOKEN,
verify=False
)
if service:
print("connected....)

except Exception as e:
print(e)


try:
service.users.create(
username="test123",
password="test321",
roles="admin"
)
except Exception as e:
print(f"and as it goeeees {e}")

 

TimeoutError: [Errno 60] Operation timed out

 

 

suggestions or guidance would be awesome if any

Sincerely

Haydar

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

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...