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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

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