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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...