Splunk Search

eval an existing field which is used for a lookup...

ndcl
Path Finder

Hi Base,
when I do an eval on an existing field which is also used for a lookup than the lookup ignores the eval result and use the origin instead.
f.e. I have IP addresses from 2 fields fieldIpA and fieldIpB and I combine them

| eval fieldIpA=coalesce(fieldIpA,fieldIpB)

If I do a “stats list(fieldIpA)” I will get a list with the results from both. If I do a lookup to resolve the IP to something else:

| lookup IPDes Description as rIPs

Then the lookup only return the results from fieldIpA.
If I add to the probs.conf declaration:

LOOKUP-< rIP> = fieldIpA AS tIP OUTPUT Description as rIPs

and do the eval with the tIP field than I get empty results and no lookup.
How it is possible to get the lookup to work?

Thanks!

0 Karma
1 Solution

ndcl
Path Finder

2 lookups doing the job. Declare a lookup for both fields in prop.conf:

LOOKUP-< rIPA> = aLOIP AS fieldIpA OUTPUT Description as ArIPs
LOOKUP-< rIPB> = bLOIP AS fieldIpB OUTPUT Description as BrIPs

Point the lookups to the same file in transforms.conf:

[aLOIP]
filename = ip_Des.csv
[bLOIP]
filename = ip_Des.csv

Now the Search look like this:

... | lookup aLOIP Description as ArIPs | lookup bLOIP Description as BrIPs | eval NewrIPs=coalesce(ArIPs,BrIPs) | stats list(NewrIPs)

If you want you can skip the Description part in the lookup.

View solution in original post

0 Karma
Get Updates on the Splunk Community!

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 ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...