Splunk Search

How to populate field values from one lookup table to another?

Italy1358
Path Finder

I am trying to pull two fields from the lookup_ims lookup table and depending on the user entered I want to populate the category and department fields and place it in the USB.csv.

<query>
| inputlookup USB.csv
| lookup_ims t fields category, Department
| append [ | makeresults
| eval user="$user_tok$", description="$description_tok$", revisit="$revisit_tok$", Action="$dropdown_tok$"]
| eval _time=now()
| table _time, user, category, department, description, revisit
| outputlookup USB.csv
</query>



Labels (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Something like this

| inputlookup USB.csv
| append [ | makeresults
| eval user="$user_tok$", description="$description_tok$", revisit="$revisit_tok$", Action="$dropdown_tok$" | lookup yoursecondLookup lookupfield as fieldtomatch OUTPUT category department | eval _time=now()]
| table _time, user, category, department, description, revisit
| outputlookup USB.csv

View solution in original post

somesoni2
Revered Legend

Something like this

| inputlookup USB.csv
| append [ | makeresults
| eval user="$user_tok$", description="$description_tok$", revisit="$revisit_tok$", Action="$dropdown_tok$" | lookup yoursecondLookup lookupfield as fieldtomatch OUTPUT category department | eval _time=now()]
| table _time, user, category, department, description, revisit
| outputlookup USB.csv

somesoni2
Revered Legend

What field is common between ABC.csv and your second lookup? If you're looking to add category and Department field only for the new (user selected) row, do the lookup inside append subsearch.

0 Karma

Italy1358
Path Finder

Hey @somesoni2 yes, I am looking to add category and department field only for the new user selected and output this to the USB.csv. Could you provide an example of what you mean? I am a new user to Splunk.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...