Getting Data In

How to add some filters to |lookup ?

rendie
Path Finder

Hi,
I use this command for filtration data by lookup file record...
| lookup loopup.csv lookupname AS searchName OUTPUTNEW fieldtype, fieldvalue
And I have result from index=name where field searchName is lookupname.

How should I write search that would use for example | lookup loopup.csv lookupname AS searchName, lookupname AS searchField OUTPUTNEW fieldtype, fieldvalue and take result where field searchName is lookupname and lookupname is searchField

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @rendie,
I'm not sure to have completely understood your request: you want to add fieldtype and fieldvalue when lookupname matches searchName and searchField, is it correct?
if this is your request, please, try to use two time lookup command:

Your_search
| lookup loopup.csv lookupname AS searchName OUTPUT fieldtype AS fieldtype1 fieldvalue AS fieldvalue1
| lookup loopup.csv lookupname AS searchField OUTPUT fieldtype AS fieldtype2 fieldvalue AS fieldvalue2
| ...

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...