lookup¶
Type of operation: Join
Description¶
Find matching rows in a Resource or Interval dataset, making new columns in the output dataset. The lookup verb takes a join predicate in the form of on([email protected] and [email protected] ..)
, which defines what to look up by. The equality conditions in the predicate must follow one of the links. The remaining arguments should be of the form name:@target.value, which define what values to retrieve from the target dataset.
Usage¶
lookup [ predicate ] ... [ , columnbinding ] ...
Argument |
Type |
Required |
Multiple |
---|---|---|---|
predicate |
bool |
Optional |
Can be multiple |
columnbinding |
expression |
Optional |
Can be multiple |
Accelerable¶
lookup is always accelerable if the input is accelerable. A dataset that only uses accelerable verbs can be accelerated, making queries on the dataset respond faster.
Examples¶
lookup on([email protected] and [email protected]), hostname:@host.name, hostip:@host.ip
Using the values for ‘host_uid’ and ‘host_cluster’, look up the rows matching the same ‘uid’ and ‘cluster’ values in the input table named ‘host’. Extract the ‘name’ and ‘ip’ values from those ‘host’ dataset rows, using them populate new columns in the output called ‘hostname’ and ‘hostip’.