Splunk Dev

Custom search command (v2/chunked): A lot of time passes between prepare() and generate()

spunk_enthusias
Path Finder

I am building a GeneratingCommand and even in the most basic version a lot of time passes between the invocation of prepare() (called after about 50ms after start) and generate() (called about 170ms after start).

We plan to invoke this command frequently, so this gap matters. How can I reduce it?

0 Karma

spunk_enthusias
Path Finder

Now here's an interesting tidbit: Where a bare-bones Python script using Splunklib takes 170ms to dispatch.evaluate, a dbxquery from DB Connect takes 80ms for a whole query! And that's also with a chunked python3 search command.

So what's different? It doesn't use splunklib! Or at least not the Python version. The Python script acting as the bridge simply forwards the search protocol messages to a TCP server which likely uses the Java implementation.

I've said before that splunklib could use some attention - case in point.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...