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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...