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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...