system-table-last-logs

Retrieves the most recently ingested record for each table.

Command properties

PropertyDescription
Command typeDriver query
Required permissionNone
License usageNot counted
Parallel executionNot supported
Distributed executionNot supported

Syntax

system-table-last-logs [table=TABLE_PATTERN]

Options

table=TABLE_PATTERN
Specifies the list of tables to query. Separate multiple tables with a comma (,). Wildcards (*) can be used at the beginning or end of a name. If not specified, all tables for which the user has read permission are queried.

Output fields

FieldTypeDescription
table_namestringTable name
datetimestampTimestamp of the most recently ingested record
datamapContent of the most recently ingested record

Error codes

Parsing errors

N/A

Runtime errors

N/A

Description

The system-table-last-logs command retrieves the most recently ingested record for each table. If a table has no data or the latest partition cannot be retrieved, the date and data fields return null.

Tables for which the user does not have read permission are excluded. Administrators can query all tables.

Examples

  1. Retrieve the latest record for all tables

    system-table-last-logs
    

    Retrieves the most recently ingested record for all tables the user has read permission for.

  2. Retrieve the latest record for a specific table

    system-table-last-logs table=my_table
    

    Retrieves the most recently ingested record from the my_table table.

  3. Detect tables with stale data

    system-table-last-logs
    | search isnotnull(date)
    | eval hours_ago = datediff(now(), date, "h")
    | search hours_ago > 24
    | sort -hours_ago
    

    Retrieves tables that have not received data within the last 24 hours.