COVID-19 Response
SplunkBase
Developers
Documentation
Browse
Community
Community
Splunk Answers
Splunk Administration
Deployment Architecture
Installation
Security
Getting Data In
Knowledge Management
Monitoring Splunk
Using Splunk
Splunk Search
Reporting
Alerting
Dashboards & Visualizations
Splunk Development
Building for the Splunk Platform
Splunk Platform Products
Splunk Enterprise
Splunk Cloud Platform
Splunk Data Stream Processor
Splunk Data Fabric Search
Splunk Premium Solutions
Security Premium Solutions
IT Ops Premium Solutions
DevOps Premium Solutions
Apps and Add-ons
All Apps and Add-ons
Discussions
Community Blog
Training + Certification
Career Resources
#Random
Getting Started
Welcome
Intros
Feedback
Splunk Tech Talks
Product News & Announcements
BOSS: BOO & BOTS
BOSS Calendar
BOSS Announcements
SplunkTrust
User Groups
Americas
Europe, Middle East and Africa
Asia-Pacific
Industry
Splunk Love
Ideas
Sign In
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Building for the Splunk Platform
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Ask a Question
Community
:
Splunk Answers
:
Splunk Development
:
Building for the Splunk Platform
:
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
Get Updates on the Splunk Community!
Splunk Training for All: Meet Aspiring Cybersecurity Analyst, Marc Alicea
Splunk Education believes in the value of training and certification in today’s rapidly-changing data-driven ...
Investigate Security and Threat Detection with VirusTotal and Splunk Integration
As security threats and their complexities surge, security analysts deal with increased challenges and ...
Observability Highlights | January 2023 Newsletter
January 2023New Product Releases Splunk Network Explorer for Infrastructure MonitoringSplunk unveils Network ...
Read our Community Blog >