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!

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