Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Selects some values and discards the rest.

select (field|assignment)...

This operator keeps only the provided fields and drops the rest.

The field to keep. If it does not exist, it’s given the value null and a warning is emitted.

An assignment of the form <field>=<expr>.

Keep a and introduce y with the value of b:

from {a: 1, b: 2, c: 3}
select a, y=b
{a: 1, y: 2}

A more complex example with expressions and selection through records:

from {
name: "foo",
pos: {
x: 1,
y: 2,
},
state: "active",
}
select id=name.to_upper(), pos.x, added=true
{
id: "FOO",
pos: {
x: 1,
},
added: true,
}

Last updated: