Transposes (transforms) table data by converting columns into rows, switching the orientation. This is a great way of reorganizing data into a more readable format or a format that can be more easily applied to other display formats as part of a widget. Use transpose() to 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]   Field to use as header value.
limitintegeroptional[a] 5 Maximum number of rows to transpose.
  Minimum1 
  Maximum1,000 
pivot[b]stringoptional[a]   Field to use as both 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

Search Accross Multiple Structured Fields

Search across multiple structured fields using the transpose() function within groupBy()

Transpose a Basic Table

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