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

😞

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...