Hi Guys,
I have a string say example : abc
this string I want to lookup and match the presence in a lookup table | lookuptable test.csv
test.csv has value
Number | Value |
1 | xyz |
2 | abc |
3 | mnp |
4 | wgf |
I want to check the presence of my search string abc in lookup table and shows me yes or no in result table
Like if found in lookuptable should result me as Yes else NO
example abc is present in lookuptable so my output should be
Search string | Presence |
abc | Yes |
my search string abc
| inputlookup test.csv| table value | rename value AS V1
| eval x="searchstring"
| eval y="v1"
| eval match=if(match(x,y),1,0)
| where match=1
| table Searchstring, Yes
I tried this but didnt get result
Kindly help me !
Thanks in advance
Firstly, you're mixing cases. With field names v1 is not the same as V1.
Secondly, you're setting y to a literal "v1" string. It has nothing to do with the v1 field (mind also the case remark above).
Thirdly, the match() function is a regex match.
And lastly - will you be trying to integrate it into some bigger search? If so, then you'll probably need some another approach.
Do you mean something like this?
| inputlookup test.csv
| table value
| rename value AS V1
| eval x="searchstring"
| eval presence=if(match(V1,x),"Yes","No")
| where presense="Yes"
| table V1, presence
Thanks for the response but
when I try same logic I didnt get any result
resulting table should tell me if present yes and if not present no
I tried above but only shows no result found
Try without the where command