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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...