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!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...