You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/search/search-query-language/search-operators/sort.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,18 @@ sidebar_label: sort
6
6
7
7
The `sort` operator orders aggregated search results. The default sort order is descending. Then you can use the top or limit operators to reduce the number of sorted results returned.
8
8
9
-
Order is also synonymous with sort. You can use them interchangeably in your queries.
9
+
The `order` operator is synonymous with the `sort` operator. You can use them interchangeably in your queries.
10
10
11
11
## Syntax
12
12
13
13
```sql
14
14
sort by <field> (displays results as descending, by default)
15
15
```
16
16
17
+
```sql
18
+
order by<field> (displays results as descending, by default)
19
+
```
20
+
17
21
```sql
18
22
sort by +<field> (displays results as ascending)
19
23
```
@@ -51,6 +55,11 @@ status AND down | extract "user=(?<user>.*?):" | count (*) group by user | sort
51
55
... | count user | sort by _count asc
52
56
```
53
57
58
+
```sql
59
+
| parse "GET * "as url | count by url | order by _count
60
+
| order by _count asc
61
+
```
62
+
54
63
### Top 10 pages by page hits
55
64
56
65
This example counts page hits by sourceHost, sorts them by page hits, and limits the results to the top 10.
0 commit comments