lookuptable

Enumerates and outputs the data stored in a lookup as records.

Command properties

ItemDescription
Command typeDriver query
Required permissionRead permission on the lookup
License usageNon-licensed command
Parallel executionNot supported
Distributed executionNot supported

Syntax

lookuptable TABLE [offset=LONG] [limit=LONG] [FIELD, ...]

Options

offset=LONG
Number of records to skip. Only natural numbers are allowed.
limit=LONG
Maximum number of records to retrieve. Only natural numbers are allowed.

Target

TABLE
Name of the lookup to look up
[FIELD, ...]
List of fields to output. Multiple fields can be specified separated by commas (,). If omitted, all fields of the lookup are output.

Error codes

Parse errors
Error codeMessageDescription
20705missing lookuptable nameWhen the lookup name is not specified
20706invalid lookuptable: [name]When a non-existent lookup name is specified
20707unsupported lookuptable: [name]When the lookup does not support data enumeration
20708no lookuptable permission for [name]When there is no read permission for the lookup
20709offset option of lookuptable should be natural numberWhen the offset value is 0 or less, or not a number
20710limit option of lookuptable should be natural numberWhen the limit value is 0 or less, or not a number
20711unsupported lookuptable field: [name]When a field that does not exist in the lookup is specified
Runtime errors

N/A

Description

The lookuptable command enumerates and outputs data stored in a lookup as records. While the lookup command looks up values from a lookup using the key field of input records, the lookuptable command outputs the entire data of a lookup as records.

You can paginate using the offset and limit options. When a field list is specified, only those fields are output.

Only lookups that support data enumeration can be used.

Examples

  1. Retrieve all data from a lookup

    lookuptable ip_asset
    

    Outputs all records from the ip_asset lookup.

  2. Retrieve only the top N records

    lookuptable ip_asset limit=10
    

    Outputs up to 10 records from the ip_asset lookup.

  3. Apply offset and limit

    lookuptable ip_asset offset=100 limit=50
    

    Skips the first 100 records from the ip_asset lookup and outputs the subsequent 50 records.

  4. Retrieve specific fields only

    lookuptable ip_asset ip, hostname, department
    

    Outputs only the ip, hostname, and department fields from the ip_asset lookup.