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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

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

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...