Splunk Search

Using lookup tables and searching it twice

rmorlen
Splunk Employee
Splunk Employee

We have a user lookup table that contains information such as username, email, and managername. I can do a lookup to find a user's managername.

| inputlookup userlookup | search username="bob" | fields username, email, manager

From that I would like to get the email address for the manager. Something like:

| inputlookup userlookup | search username="bob"| fields manager | rename manager AS empManager | search [| inputlookup userlookup username=empManager]

Which doesn't work because the syntax is all screwed up (and I'm not good with lookup tables).

Tags (1)
0 Karma
1 Solution

sc0tt
Builder

I think something like this should work:

..search | fields username
| lookup userlookup username OUTPUT manager
| lookup userlookup username as manager OUTPUT emailaddress

Since you have the manager name in the lookup table, it may be a good idea to just include an additional field with the manager's email.

View solution in original post

sc0tt
Builder

I think something like this should work:

..search | fields username
| lookup userlookup username OUTPUT manager
| lookup userlookup username as manager OUTPUT emailaddress

Since you have the manager name in the lookup table, it may be a good idea to just include an additional field with the manager's email.

rmorlen
Splunk Employee
Splunk Employee

Thank you. That worked.

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