Short answer is - you can't. Not within a single search. Long answer - The search pipeline is parsed at the beginning of the search. All macros and variables are expanded into static values, subsearches are evaluated and rendered into static vales as well. So you can't just dynamically "choose" which lookup to use at that point of your search. The lookup command definition and syntax says that you need an explicitly given lookup name as well as set of input and output fields. So there is no place for "variability" in the search itself. What you can do - if you have only two or three search variants - is to run all of the searches outputting the results to different fields or sets of fields and after that conditonally evakuate your main result field to be one of those looked up fields. Not very pretty but should work. You can also use the map command to spawn separate search for each result of your primary search. Then you could indeed use a variable lookup name since each pass of the lookup call would be from a separate search but - especially if your result has mor than a few resultin event - it's a horrible idea performance-wise since you're spawning new searches.
... View more