reverse
Flip the order of the rows.
Use reverse to flip the current order of your result rows without choosing a new sort field.
Syntax
... | reverseHow it works
reverseflips the current order without sorting on a new field.- On raw events, which come back newest first,
reverseputs them oldest first.* | reverse | head 20gives the 20 oldest events in the time range. - After
head N,reverseshows those N events oldest first.
Examples
The first logons in the time range, oldest first:
class_uid=3002 | reverse | head 20 | table time, user.name, src_endpoint.ipThe ten newest process launches, in reading order:
class_uid=1007 | head 10 | reverse | table time, device.hostname, process.cmd_lineFlip an aggregated ranking to show the smallest groups first:
class_uid=4002 | stats count by http_request.url.hostname | reverseNotes
- To order by a field, use
sortdirectly (sort -countrather thansort count | reverse).
reverse also works after a lookup, prevalence, inputlookup, resolve_identity, or ai stage.