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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...