All Apps and Add-ons

Unable to connect to Splunk server through python script

marisstella
Explorer

Hello guys,
I have a python script, which collects Host, Port, username, password to create a connection. After this, it will pass the query and fetches the data from splunk.
My script is working perfectly if I run the script in local machine with local machine Host (means, Splunk has installed in the same machine)
But when I use the same script to connect with splunk which is running in AWS machine, it is unable to create a connection.

So what can be the issue?
SSH certificate? if, Yes, how can I specify this attribute in the script?

my script has only these:
host = host,
port = port,
username = username,
password = password

Any other issues?

0 Karma
1 Solution

PavelP
Motivator

are you trying to execute the script on your local machine and connect to a Splunk running in AWS?

First check that you can create a TCP connection and it's not blocked by firewall:

curl -vk https://<username>:<password>@<yourSplunkIP>:8089/

for example:

 curl -vk https://marisstella:password@54.1.2.3:8089/

View solution in original post

0 Karma

PavelP
Motivator

are you trying to execute the script on your local machine and connect to a Splunk running in AWS?

First check that you can create a TCP connection and it's not blocked by firewall:

curl -vk https://<username>:<password>@<yourSplunkIP>:8089/

for example:

 curl -vk https://marisstella:password@54.1.2.3:8089/
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...