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!

.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 ...