Splunk Search

How to pass static string via lookup to stats command?

dfphere
Explorer

I'm attempting to utilize a lookup to pass static strings to create 'stats' commands. The result is sent to the search but it's treated as a large string instead of the various  values/statistical operations that are part of the search. I'm wondering if there's a way to get Splunk to interpret the command as intended.

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Unfortunately it can't (yet) be done - I created a Splunk idea a couple of years ago for this

https://ideas.splunk.com/ideas/EID-I-398

but it's not been adopted - although marked as 'future prospect'.

 

dfphere
Explorer

Bummer, but I upvoted to help the cause. Any chance you found a work around?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Sadly no workaround - the idea of using externally defined control strings to influence SPL just isn't practically possible other than in the way represented in the idea.

I guess the 'workaround' is to try to understand your use case to see why you are trying to do that anyway and whether you really need it.

You can do some generic stuff with macros, but even then, not really dynamically, as macros are expanded _before_ the search is executed, so cannot take account of field values in the pipeline

😞

Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...