Transpose a (table-like) query result by creating an event (row) for each column (attribute name), in which attributes are named row[1], row[2], etc.

ParameterTypeRequiredDefault ValueDescription
columnstringoptional[a] column Field to use as column value.
headerstringoptional[a]   Use this field as header value.
limitintegeroptional[a] 5 Maximum number of rows to transpose.
  Minimum1 
  Maximum1,000 
pivot[b]stringoptional[a]   Use this field as header AND column value.

[a] Optional parameters use their default value unless explicitly set.

[b] The parameter name pivot can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

For example, given a query that returns a table, such as:

logscale
groupBy(loglevel)
loglevel _count
ERROR 2
WARN 400
INFO 200

The result can be transposed to:

logscale
groupBy(loglevel)
| transpose()
column row[1] row[2] row[3]
_count 2 400 200
loglevel ERROR WARN INFO

To use the loglevel row as the header, use:

logscale Syntax
...
| transpose(header=loglevel)
column ERROR WARN INFO
_count 2 400 200

transpose() Examples

Click + next to an example below to get the full details.

Create a Pivot Table

Creating a view of LogScale activity

Transpose a Basic Table

Transposing an event set effectively switches rows (each event) into columns (an event)