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