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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...