REST Commands : Aggregate Query Command : Special Grouping Functions : FIRST and LAST Functions

FIRST and LAST Functions
The FIRST and LAST functions are similar to the TOP and BOTTOM functions except that a limited set of groups are returned based on the group names instead of the metric values.
GET /LogDepot/AppLogs/_aggregate?m=COUNT(*)&q=UserSID='S-1-5-18'&f=FIRST(3,EventID)
This query returns the first 3 groups based on the alphabetical sorting of EventID values. LAST returns the last groups in descending sort order. These functions help with aggregate queries that must be “paged”.