Sort Command

Use this command to sort logs according to specified fields.

Syntax

sort [+|-] <field_name> (,[+|-]<field_name>)*

Parameters

The following table lists the parameters used with this command, along with their descriptions.

Parameter Description

field_name

Use this parameter to specify the field according to which you want the results sorted.

+ | —

Specify + to sort the results in ascending order, and - to sort the results in descending order. If neither + nor - are specified, then the results are organized in ascending order, by default.

For examples of using this command in typical scenarios, see:

The following query returns the list of fatal logs, arranged in descending order, according to time.

Severity = fatal | fields Time, Target, 'Target Type' | sort -Time