I think you can do what you want by having 2 lookups defined, where the results of one lookup are used in the next. Here is a similar question Can I chain fields together between two different lookups? There is a nice discussion there. Here's a summary, tailored to your specific question. Edit props.conf as follows
## props.conf
LOOKUP-ltable1 = lookup_city_name idx OUTPUT location
LOOKUP-ltable2 = lookup_distance location OUTPUT chi,lon,nyc
But I think that a better way to arrange the second table might be
from,to,distance
chi,lon,6
lon,chi,6
chi,ny,2
ny,chi,2
etc.
This duplicates the entries, because you need an entry for london-to-chicago as well as chicago-to-london, but it makes the logic easier. Unless you are dealing with millions of entries, don't worry about performance.
If you do this, your second lookup could be
LOOKUP-ltable2 = lookup_distance from, to OUTPUT distance
... View more