On this page
limit command
Cap the number of rows returned.
Caps the number of rows the query returns, keeping the first ones under the current order.
Syntax
ObiQL
| limit <count>Square brackets mark an optional part, and angle brackets a value you supply.
Arguments
| Argument | Required | Description |
|---|---|---|
<count> | Required | A whole number of rows to keep. |
Usage
- limit caps result rows. The
limit=option ontimechartis different: it controls how many series a chart draws. - After dedup, limit counts the rows that survive, so
| dedup service | limit 20means twenty distinct services.
Examples
1. Top ten routes by traffic
ObiQL
| stats count() by route | sort -count | limit 10Sort first so the limit keeps the largest rows.
2. The latest few errors
ObiQL
level="error" | limit 5Events come back newest first, so this is the five most recent errors.