Holy crap guys, I found some hints in the Splunk Dev For All app!!! This has a fairly small (Python 2) utility library called "cexec" implementing the chunked search protocol! Here's a part of its docstring: This library abstracts away some of the low-level details of writing "chunked" custom search commands for Splunk (e.g. byte-level protocol parsing). However, it still requires a fair bit of background on how the chunked protocol works at a semantic level. For a detailed description of the protocol, read: https://confluence.splunk.com/display/PROD/Chunked+External+Command+Protocol+v1.0 At a high-level, the Splunk search pipeline operates on "chunks" of search results. Thus, when a "chunked" custom search command is in a search pipeline, Splunk will send chunks to the external command (on stdin) and expect chunks in reply (on stdout). This library implements a BaseChunkHandler class that handles most of the details of receiving and sending chunks. Developers are expected to extend this class with their own handler() method to actually do useful work on search results. Sadly the linked Confluence page is offline, not saved by the Internet Archive and a web search for "Chunked External Command Protocol v1.0" yields exactly 0 results (how often does that happen?). Luckily the library only has 368 lines, is well commented and quite readable! So that's probably some of the best documentation we have. Still baffling that Splunk Inc. seems to want to keep information about the chunked search protocol a secret. That together with the atrocious performance (200ms MINIMUM) makes using them for utility functionality inviable. And do you know what that means? We'll use the custom command exactly once and do all processing outside of Splunk. If the bad experience of custom search commands is meant to hamper migration away, congratulations, you played yourselves.
... View more