NQL sort

A sort ... asc or sort ... desc clause orders the results by a field in ascending or descending order, respectively.

Syntax

Sort data starting from the lowest value:

....
| sort <field name> asc

Sort data starting from the highest value:

....
| sort <field name> desc

Examples

Sort users by their username in alphabetical order:

users during past 7d
| list username, type
| sort username asc
NameType

Alice Smith

LOCAL_USER

Amanda Carella

LOCAL_ADMIN

Sort users by their username in reverse alphabetical order:

users during past 7d
| list username, type
| sort username desc
NameType

Zion Bush

LOCAL_USER

Zachary Doe

LOCAL_ADMIN

Last updated