Splunk Search

Evaluate search with lookup field?

gljiva
Path Finder

Hi, I'm having problem with evaluating expression using lookup field. I create a lookup fileld by executing this search:
some search| stats avg(count) as Average | outputlookup Average.csv

Next i would like to use this value in other searches to evaluate some field with saved lookup value. I tried using lookup command but i can not append single field to all results, i can append field to separate entry but then i cant do: eval field1 > field2.

Any suggestions?
thx

0 Karma
1 Solution

Paolo_Prigione
Builder

What about using a fake lookup-field? Something like:

some search | stats avg(count) as Average | eval keyfield=12345 | outputlookup Average.csv

which will save two columns in the csv file: "keyfield" and "Average". Then, when you run the actual search you could do:

query search | eval keyfield=12345 | lookup Average.csv keyfield OUTPUT Average | where somefield > Average

in order to retrieve the stored value and filter results based on the stored Average.

View solution in original post

Paolo_Prigione
Builder

What about using a fake lookup-field? Something like:

some search | stats avg(count) as Average | eval keyfield=12345 | outputlookup Average.csv

which will save two columns in the csv file: "keyfield" and "Average". Then, when you run the actual search you could do:

query search | eval keyfield=12345 | lookup Average.csv keyfield OUTPUT Average | where somefield > Average

in order to retrieve the stored value and filter results based on the stored Average.

gljiva
Path Finder

Thanks, this works!

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...