Deployment Architecture

Custom search command for distributed search

davecroto
Splunk Employee
Splunk Employee

if I write a custom search command, do I have to put the .py script on both the search head and the indexer?

gkanapathy
Splunk Employee
Splunk Employee

It depends. If you put it into an app directory, it will be replicated to the indexers, where it will be run from the replicated bundle. If it happens to be pure python, and all additional libraries are also replicated in the app, and doesn't reference any absolute paths, but only files and paths etc relative to the app directory, then it will run fine.

hexx
Splunk Employee
Splunk Employee

I suppose that you want your command to work in a distributed search environment and be executed on each search peer.

The answer is that you can keep your search command just on the search-head but you'll need to set streaming = true when defining your command in commands.conf. That will ensure that your command is distributed.

Note that you still need to set streaming = true even if your command is not a streaming command but say, an event-generating command.

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