Splunk Search

Can you launch a search from within a custom search command?

MarcHelou
New Member

Hello,
I have already created a custom search command, Can I launch from my python scripy a search that gets me values I need to continue my custom search command?
Not passing them as arguments but running a search inside the custom command script?

0 Karma

supersleepwalke
Communicator

I was also looking to answer this question. Much of the documentation that exists is for version 1 of the custom search command protocol, which was deprecated in Splunk 6.4.0. I posted an example here: https://answers.splunk.com/answers/434017/how-to-get-session-key-in-a-search-script-script-s.html#an...

0 Karma

micahkemp
Champion

You definitely can, and the key to that is passing your sessionKey to your custom search command so that it can pass said key back to the Splunk REST API. This answers post lays out the major components you're looking for:

https://answers.splunk.com/answers/434017/how-to-get-session-key-in-a-search-script-script-s.html

0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...