I want to include a value from a lookup table in search results, by using a field value from the main search.
That's common and easy. Just add | lookup somelookupfile.csv <lookup field> AS <field name from the main search>
to your query.
See https://docs.splunk.com/Documentation/Splunk/8.0.4/Search/Useexternalfieldlookups and https://docs.splunk.com/Documentation/Splunk/8.0.4/SearchReference/lookup for more information.