Splunk Search

running splunk search using python sdk

harsh1734
New Member

hi,
i have installed python sdk and in ./splunkrc file given user name and passwd so that it can connect my splunk ..i have a index name called test. so what should be my search so that by using my python sdk i can call that index content

Tags (1)
0 Karma

HiroshiSatoh
Champion

What error is the output? Do you have made ​​well Preferences?
For example, this sample program work?

Please to save and run the file with the appropriate name by setting the HOST,USERNAME,PASSWORD.
---------(sample program)------------------
import splunklib.client as client

HOST = "hostxxxx"
PORT = 8089
USERNAME = "username"
PASSWORD = "password"

try:
service = client.connect(
host=HOST,
port=PORT,
username=USERNAME,
password=PASSWORD)
print "connect OK!"
except:

print "connect NG!"

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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