Splunk Search

How to run a saved search in a remote Splunk server and print the result on the terminal using Python SDK?

bckq
Path Finder

Hi,
I wanted to make some script that will run saved search in remote Splunk Server and print the result on the terminal/console. I found that example: http://dev.splunk.com/view/python-sdk/SP-CAAAEK2 , but it looks like some part of code is missing. I also tried to connect that example with examples included in SDK Python (oneshot.py), but still it doesn't want to work for me.

Do you have any simple solution to run saved search in remote Splunk Server and print it in terminal?

0 Karma

jrodman
Splunk Employee
Splunk Employee

Simplest method.

bin/splunk search "*" -uri https://remotesplunk:8089

If you want to use python SDK, there is no difference between running a search locally and remotely. They both use the REST interface to run the search. One thing to be aware of is 'admin' 'changeme' will not work remotely, because this is insecure. Be sure you are using an account without a default password.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...