Splunk Search

Splunk Filter from Lookup

Thulasinathan_M
Contributor

Hi Splunk Experts,
I've a lookup with field 'User', 'Rates' and 'Priority' (values 1 to 5). I use this lookup in my search, I wish to accomplish below Use cases. Kindly advice if it's possible.

Cases:
Lookup Priority value is '5', I've to get the max(Rates) from Priority Values 1 to 5.
Lookup Priority value is '4', I've to get the max(Rates) from Priority Values 1 to 4.
Lookup Priority value is '3', I've to get the max(Rates) from Priority Values 1 to 3.
Lookup Priority value is '1', I've to get the max(Rates) from Priority Values 1.

Labels (1)
Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Thulasinathan_M ,

please try this:

| inputlookup your_lookup.csv
| stats 
     max((eval(Priority=*, Rate, 0))) AS Rate_5
     max((eval(Priority<5, Rate, 0))) AS Rate_4
     max((eval(Priority<4, Rate, 0))) AS Rate_3
     max((eval(Priority<2, Rate, 0))) AS Rate_1
     BY User

Ciao.

Giuseppe

0 Karma

Thulasinathan_M
Contributor

Thanks @gcusello,
But this will create a multiple fields, but I wish to have this in a single field and results duplicated as each entity. So it'll be easy for me to use lookup join

Example Dataset:

USERRatePriority
UX1011.42
UX1012.34
UX3424.65
UX5157.31
UX5152.13

 

Expecting Output:

USERRatePriority
UX1011.41
UX1011.42
UX1012.33
UX1012.34
UX1012.35
UX3424.61
UX3424.62
UX3424.63
UX3424.64
UX3424.65
UX5157.31
UX5157.32
UX5157.33
UX5157.34
UX5157.35
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – November 2025

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

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...