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

😞

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...