Selects specified fields from the input to keep in the output.

The order of the fields in the result is determined by their original order in the dataset. Only the fields that are specified as arguments are kept. The other fields are excluded from the result. See project for more detail.

Syntax

| project-keep FieldName1, FieldName2, ...

Arguments

nametypedescription
Field NamestringThe name of the field to be kept in the output.

Returns

A table with fields that are named as arguments. Contains the same number of rows as the input table.

Examples

['http-logs']
| project-keep  ['geo.city'], ['geo.country'], method

Run in Playground

Wildcard

Wildcard refers to a special character or a set of characters that can be used to substitute for any other character(s) in a search pattern. The use of wildcards in Axiom allows you to create more flexible queries and perform more powerful searches.

  • In Axiom, the syntax for wildcard can either be data* or ['data.fo']*

Here’s how you can use wildcards in project-keep

['sample-http-logs']
| project-keep resp*, content*,  ['geo.']*

Run in Playground

['github-push-event']
| project-keep size*, repo*, ['commits']*, id*

Run in Playground