We have a foo.csv which will be updated regularly, and we have searches which require some of the data in foo.csv to run properly. I would like to solve this using a macro in the searches, but am hav...
See more...
We have a foo.csv which will be updated regularly, and we have searches which require some of the data in foo.csv to run properly. I would like to solve this using a macro in the searches, but am having difficulties. foo.csv field1,field2,field3
bar11,bar21,bar31
bar12,bar22,bar32
bar13,bar23,bar33 I need "bar11","bar12","bar13" to be inserted to a search, like so: | pivot fooDM barData
min(blah) AS min_blah
filter field1 in ("bar11","bar12","bar13") So I created a macro which (when run alone in a search) gives a quoted comma separated list, myMacro: [| inputlookup foo.csv
| strcat "\"" field1 "\"" field1
| stats values(field1) AS field1
| eval search=mvjoin(field1, ",")
| fields search] The above macro I've attempted both "Use eval-based definition" and not, and place it in search like this: | pivot fooDM barData
min(blah) AS min_blah
filter field1 in (`myMacro`) I would love any help. Thank you!