Browse docs
On this page

table command

Project down to specific fields for display or export.

All ObiQL commands

Keeps only the named fields, in the order given, for display or export. fields and table are two names for the same stage.

Also written as fields, which behaves identically.

Syntax

ObiQL
| fields <field> [, <field> ...]
| table <field> [, <field> ...]

Square brackets mark an optional part, and angle brackets a value you supply.

Arguments

ArgumentRequiredDescription
<field>, ...RequiredThe fields or result columns to keep, separated by commas or spaces. Quote a name that contains a space: "Total Errors".

Usage

  • After stats, only the by fields and the aggregate columns can be selected.
  • Projection only changes what is shown and exported. Stored events are untouched.

Examples

1. A narrow view of events

ObiQL
service=checkout-api | fields timestamp, level, route, duration_ms

Shows just these four columns.

2. Choose columns after stats

ObiQL
| stats count() by repository | fields repository, count()

An aggregate can be named the way it was written, by its column name, or by its AS name.

3. Include an enriched column

ObiQL
| lookup hostname_map hostname AS host OUTPUT owner_team | fields host, owner_team, message

Columns added by lookup can be projected.