The table()
function displays query results
in a table, allowing to specify the list of fields to include in
the table.
The table()
function is an aggregate
function and does as follows:
For large data exports, consider using the
select()
function instead. The
select()
function provides similar tabular
output but without row limits or sorting constraints.
Parameter | Type | Required | Default Value | Description |
---|---|---|---|---|
fields[a] | array of strings | required | The names of the fields to select. | |
limit | number | optional[b] | 200 | The argument given to this parameter determines the limit on the number of rows included in the result of the function. The maximum is controlled by the StateRowLimit dynamic configuration, which is StateRowLimit by default. If the argument is max (limit=max ), then the value of StateRowLimit is used. |
Values | ||||
Default | 200 | (removed in 1.183) | ||
100,000 | (added in 1.184) | |||
Maximum | 50,000 | The maximum limit is not static and can be changed by setting the
StateRowLimit
dynamic configuration. (removed in 1.180) | ||
100,000 | (available in 1.181 only) | |||
200,000 | (added in 1.182) | |||
max | An alias to use the maximum limit set by
StateRowLimit (added in 1.178) | |||
Maximum | 50,000 | The maximum limit is not static and can be changed by setting the
StateRowLimit
dynamic configuration. | ||
order | array of strings | optional[b] | desc | Order to sort in. |
Values | ||||
asc | Ascending (A-Z, 0-9) order | |||
desc | Descending (Z-A, 9-0) order | |||
reverse | boolean | optional[b] | Whether to sort in descending order. Deprecated: prefer order instead. | |
sortby | array of strings | optional[b] | @timestamp | Names of fields to sort by. |
type | array of strings | optional[b] | number | Type of the fields to sort. |
Values | ||||
any | Any fields. (deprecated in 1.125) | |||
hex | Hexadecimal fields | |||
number | Numerical fields | |||
string | String fields | |||
[b] Optional parameters use their default value unless explicitly set. |
table()
Syntax Examples
Create a table of HTTP GET methods displaying the fields statuscode and responsetime:
logscale
method=GET
| table([statuscode, responsetime])
Display the 50 slowest requests by name and responsetime:
logscale
table([name, responsetime], sortby=responsetime, limit=50, order=asc)