Skip to main content

lookup_tables

Creates, updates, deletes, gets or lists a lookup_tables resource.

Overview

Namelookup_tables
TypeResource
Idaws.logs.lookup_tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
descriptionstringThe description of the lookup table.
kms_key_idstringThe ARN of the KMS key used to encrypt the lookup table data, if applicable.
last_updated_timeinteger (int64)The time when the lookup table was last updated, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.
lookup_table_arnstringThe ARN of the lookup table.
lookup_table_namestringThe name of the lookup table. (pattern: <code>^[a-zA-Z0-9_]+$</code>)
size_bytesinteger (int64)The size of the lookup table in bytes.
table_bodystringThe full CSV content of the lookup table.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_lookup_tableselectregionRetrieves the full content of a lookup table, including the CSV data.
describe_lookup_tablesselectregionRetrieves metadata about lookup tables in your account. You can optionally filter the results by table name prefix. Results are sorted by table name in ascending order.
create_lookup_tableinsertregion, lookupTableNameCreates a lookup table by uploading CSV data or from CloudWatch Logs query results. You can use lookup tables to enrich log data in CloudWatch Logs queries with reference data such as user details, application names, or error descriptions. The table name must be unique within your account and Region. You must specify either tableBody or queryId, but not both. If you use tableBody, the CSV content must include a header row with column names, use UTF-8 encoding, and not exceed 10 MB.
update_lookup_tableupdateregion, lookupTableArnUpdates an existing lookup table by replacing all of its content with new CSV data or CloudWatch Logs query results. After the update completes, queries that use this table use the new data. This is a full replacement operation. All existing content is replaced. You must specify either tableBody or queryId, but not both.
delete_lookup_tabledeleteregionDeletes a lookup table permanently. This operation cannot be undone. Queries that reference a deleted table will return an error. Before deleting a lookup table, review any saved queries or dashboards that may reference it.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves the full content of a lookup table, including the CSV data.

SELECT
description,
kms_key_id,
last_updated_time,
lookup_table_arn,
lookup_table_name,
size_bytes,
table_body
FROM aws.logs.lookup_tables
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a lookup table by uploading CSV data or from CloudWatch Logs query results. You can use lookup tables to enrich log data in CloudWatch Logs queries with reference data such as user details, application names, or error descriptions. The table name must be unique within your account and Region. You must specify either tableBody or queryId, but not both. If you use tableBody, the CSV content must include a header row with column names, use UTF-8 encoding, and not exceed 10 MB.

INSERT INTO aws.logs.lookup_tables (
lookupTableName,
description,
tableBody,
queryId,
kmsKeyId,
tags,
region
)
SELECT
'{{ lookupTableName }}' /* required */,
'{{ description }}',
'{{ tableBody }}',
'{{ queryId }}',
'{{ kmsKeyId }}',
'{{ tags }}',
'{{ region }}'
RETURNING
created_at,
lookup_table_arn
;

UPDATE examples

Updates an existing lookup table by replacing all of its content with new CSV data or CloudWatch Logs query results. After the update completes, queries that use this table use the new data. This is a full replacement operation. All existing content is replaced. You must specify either tableBody or queryId, but not both.

UPDATE aws.logs.lookup_tables
SET
lookupTableArn = '{{ lookupTableArn }}',
description = '{{ description }}',
tableBody = '{{ tableBody }}',
queryId = '{{ queryId }}',
kmsKeyId = '{{ kmsKeyId }}'
WHERE
region = '{{ region }}' --required
AND lookupTableArn = '{{ lookupTableArn }}' --required
RETURNING
last_updated_time,
lookup_table_arn;

DELETE examples

Deletes a lookup table permanently. This operation cannot be undone. Queries that reference a deleted table will return an error. Before deleting a lookup table, review any saved queries or dashboards that may reference it.

DELETE FROM aws.logs.lookup_tables
WHERE region = '{{ region }}' --required
;