Connect Splunk From Python Script and pull data out of Splunk.

import splunklib.client  as client
HOST = "restapi.splunk.XXXX.com"
PORT = 443
USERNAME = "username"
PASSWORD = "password"

# Create a Service instance and log in
service = client.connect(
host=HOST,
port=PORT,
username=USERNAME,
password=PASSWORD)

# Print installed apps to the console to verify login
for app in service.indexes:
print app.name
if app.name == 'Index_name':
print app.name
print "Index Found"
else:
print "Index Not Found"

--

--

--

Hi, I am a Certified Google Cloud Data engineer. I use Medium platform to share my experience with other members of Medium network.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How would I check whether my SMPS is working?

EVERYTHING I Learned from a Summer of Software Development

TaskRabbit Review: How To Make Money On TaskRabbit?

Your Coding Adventure

Model View Controller (MVC) Pattern In Unity

POPL20 Reflections

Google Sheets Bulk Component Editor for Adobe Analytics [Video]

Chill Hack — TryHackMe — WriteUp

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vibhor Gupta

Vibhor Gupta

Hi, I am a Certified Google Cloud Data engineer. I use Medium platform to share my experience with other members of Medium network.

More from Medium

Statistical Data Analysis : Continuous variable

An Analysis of Violence Caused by Video Games

Customer Segmentation for Arvato Financial Services

Design for Understanding: Data Visualization of Billionaires Dataset