I need to search a lookup table for rows that match an input string in any field.
I've tried |inputlookup...... | search $searchKey$
but this returns no results.
How do I do this?
Try this:
| inputlookup <lookup>
| foreach * [eval matched=if(matched="YES" OR <<FIELD>>="searchkey", "YES", "NO")]
| search matched="YES"
| fields - matched
Try this:
| inputlookup <lookup>
| foreach * [eval matched=if(matched="YES" OR <<FIELD>>="searchkey", "YES", "NO")]
| search matched="YES"
| fields - matched
That's what I'm looking for. Thanks
| inputlookup <lookup name> WHERE <fieldname>=<value>
Your | search
version would probably work if you did | search <fieldname>=<value>
, but it's better to include the filter in inputlookup
itself.
Is there a way to do this without specifying the field? I just want to pass in a string x and if in one row FieldA=x and in another row FieldB=x, it will return both rows
I see I didn't really answer your question. I will revisit this in a few.