Home
Join the Community
Getting Started
Welcome
Join Slack
Be a Splunk Champion
SplunkTrust
Super User Program
Tell us what you think
Splunk Love
Community Feedback
Learn Splunk
Learning Paths
Training & Certification
Training + Certification Discussions
Training & Certification Blog
AppDynamics Knowledge Base
Share a Tip
Find Answers
Splunk Administration
Getting Data In
Deployment Architecture
Monitoring Splunk
Using Splunk
Splunk Search
Dashboards & Visualizations
Splunk Platform
Splunk Enterprise
Splunk Cloud Platform
Splunk AppDynamics
Apps & Add-ons
Splunk Development
All Apps and Add-ons
Premium Solutions
Splunk Enterprise Security
Splunk Observability Cloud
Splunk ITSI
Splunk SOAR
News & Events
Blog & Announcements
Community Blog
Product News & Announcements
Events and Contests
Tech Talks: Technical Deep Dives
Office Hours: Ask the Experts
User Groups
Resources
.conf25
SplunkBase
Developers
Documentation
Splunk Ideas
Splunk Events
Sign In
Enter a search word
Enter a search word
Enter a user name or rank
Enter a search word
Enter a search word
cancel
Turn on suggestions
Showing results for
Show
only
|
Search instead for
Did you mean:
Splunk Dev
×
Are you a member of the Splunk Community?
Sign in or Register
with your Splunk account to get your questions answered, access valuable resources and connect with experts!
All community
This category
This board
Knowledge base
Users
Products
Enter a search word
Enter a search word
Enter a user name or rank
Enter a search word
Enter a search word
cancel
Turn on suggestions
Showing results for
Show
only
|
Search instead for
Did you mean:
Ask a Question
Find Answers
:
Apps & Add-ons
:
Splunk Development
:
Splunk Dev
:
Getting Syntax error with Splunk Python SDK on por...
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark Topic
Subscribe to Topic
Mute Topic
Printer Friendly Page
Mark as New
Bookmark Message
Subscribe to Message
Mute Message
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Getting Syntax error with Splunk Python SDK on port 443
ppanteliad
New Member
12-01-2022
05:19 AM
Here's the weirdest piece of error I've ever seen. When I run the following code snippet I get a syntax error: line 1, column 0.
But when I change the port to anything else, the code is running. Any help?
import
os
import
splunklib
.
client
as
client
from
dotenv
import
load_dotenv
def
connect_to_splunk
(
username
,
password
,
host
=
'splunk.my_company.biz'
,
scheme
=
'https'
😞
try
:
service
=
client
.
connect
(
username
=
username
,
password
=
password
,
host
=
host
,
scheme
=
scheme
,
port
=
'443'
)
if
service
:
print
(
"Splunk service created successfully"
)
except
Exception
as
e
:
print
(
e
)
Labels
(3)
Labels
Labels:
Python
rest API
SDK
Tags
(2)
Tags:
open-ssl
python
0
Karma
Reply
All forum topics
Previous Topic
Next Topic
Post Reply
Register for .conf25!
Get Updates on the Splunk Community!
Splunk ITSI & Correlated Network Visibility
Now On Demand Take Your Network Visibility to the Next Level In today’s complex IT environments, ...
Leveraging Detections from the Splunk Threat Research Team & Cisco Talos
Now On Demand Stay ahead of today’s evolving threats with the combined power of the Splunk Threat Research ...
New in Splunk Observability Cloud: Automated Archiving for Unused Metrics
Automated Archival is a new capability within Metrics Management; which is a robust usage & cost optimization ...
Read our Community Blog >
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.