Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.50 is the most recent stable version of Flux.
The sort()
function orders the records within each table.
One output table is produced for each input table.
The output tables will have the same schema as their corresponding input tables.
Function type: Transformation
Output data type: Object
sort(columns: ["_value"], desc: false)
Parameters
columns
List of columns by which to sort.
Sort precedence is determined by list order (left to right).
Default is ["_value"]
.
Data type: Array of strings
desc
Sort results in descending order.
Default is false
.
Data type: Boolean
Examples
from(bucket:"telegraf/autogen")
|> range(start:-12h)
|> filter(fn: (r) =>
r._measurement == "system" AND
r._field == "uptime"
)
|> sort(columns:["region", "host", "_value"])