It is a very bad idea. For at least two reasons. One is the maintenance and accountability - change in the lookup contents will not be audited. Another, probably more important for you at this point - performance. If you have a set of search terms in the initial search, Splunk tries very hard to limit the number of events it actually has to read from the index, parse out the fields from and process down the pipeline. With a search like this Splunk has to read each single event from the index, parse it and try to match to a given search condition. An example from my home lab. If I do index=windows EventCode=4662 over last 24 hours, the search ends almost immediately (after 0.5s it takes to spawn the search) and returns nothing because I don't have any event with such event and since Splunk hadn't indexed anything with a term "4662" it just checks the tsidx file, sees there is no such term and doesn't have to read a single raw event from the index file. But if I do it "your way" index=winevents | eval match=if(searchmatch("EventCode=4662"),1,0) | where match=1 I still get no results because the events haven't suddenly magically spawned but to come up with this it took Splunk about 2.5 seconds (on my mostly empty lab) and it had to read all 23851 events from the search time range.
... View more