Skip to main content

transpose

Description

Returns the specified number of rows (search results) as columns (a list of field values), so that each search row becomes a column.

Syntax

transpose [<count>] [column_name=<string>] [header_field=<string>] [include_empty=<bool>]

Optional Arguments

ParameterSyntaxDefaultDescription
count<int>5The number of rows to transpose. If 0, all rows will be transposed.
column_namecolumn_name=<string>columnThe name of the first column to use for transposed rows. This column contains field names.
header_fieldheader_field=<string>row 1, row 2, row 3, and so onThe name of the field in your results that will be used for column names (except the first column) in the transposed data.
include_emptyinclude_empty=<bool>trueIf true, includes fields with empty values.

Query Examples

Example 1

In this example, the first five rows become columns.

... | transpose

Example 2

In this example, the first two rows become columns.

... | transpose 2

Example 3

In this example, the first five rows become columns, and the first column is named new_column.

... | transpose column_name="new_column"

Example 4

In this example, the first three rows become columns, and the column names following the first are: new_row1, new_row2, new_row3.

... | transpose 3 header_field="new_row"