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

Using Object Tagging and Row Access Policies to Secure Data in Snowflake

AWS IoT Case Study: LG Electronics

Developing and Implementing a Custom Built Locomotion Method

Load-testing Apache Cassandra; Parsing Latency & Throughput Results (Part 1 of 3)

Checkmate on Compose — Part II

createCanvas: Interview with Dan Shiffman

A smiling man in glasses and a pink shirt stands within an animation of rainbows, unicorns, and cupcakes.

Elastic Search Security Measures

Trailhead Community Content

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

Rollback strategy using Jenkins.

Overriding Pandas DataFrame in an Import Statement

Installing python dependencies using wheels

Configure Webserver -Setup python interpreter and run python code on Docker Container