--- id: top title: top Search Operator sidebar_label: top description: Use the top operator with the sort operator to reduce the number of sorted results returned. slug: /help/docs/search/search-query-language/search-operators/top/ canonical: https://www.sumologic.com/help/docs/search/search-query-language/search-operators/top/ --- import useBaseUrl from '@docusaurus/useBaseUrl'; Use the `top` operator with the [`sort`](/docs/search/search-query-language/search-operators/sort) operator to reduce the number of sorted results returned. :::tip We recommend you use the [`topk`](/docs/search/search-query-language/search-operators/topk) operator instead so you can take advantage of its additional functionality. ::: ## Syntax `top <#> [by ]` ## Examples #### List the Top 5 source categories with errors Use the following query to list the top 5 source categories with errors, and get their count. ```sumo error | top 5 _sourceCategory ``` which produces results like: Example You can use the following query to get the same results, but make the count explicit: ```sumo error | top 5 _sourceCategory by count ``` #### List the Top 10 source categories by message time This query lists the top 10 source categories by message time, without an explicit count. ```sumo error | top 10 _sourceCategory by _messagetime ``` which produces results like: Another example