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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...