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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...