--- title: "Groupby" slug: "groupby-1" tags: ["Helix Enterprise", "Reference", "Sec Ops and Analytics"] updated: 2026-09-09T16:29:16Z published: 2026-09-09T16:29:16Z canonical: "docs.trellix.com/groupby-1" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.trellix.com/llms.txt > Use this file to discover all available pages before exploring further. # Groupby The groupby transform returns the unique values for a specified field and groups them together based on their frequency. You can use this transform to determine which specific field values are most or least active in your environment and to see how those values relate to other values for the same field. Search results are displayed in a table showing the total number of values for each field. A maximum of 500 rows is displayed. To view non-grouped results, click **Show Search Results**. Click ![arrow.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-c973bc79-5c9d-6721-4ae9-fb1c1c9f35c2.png?sv=2026-02-06&spr=https&st=2026-11-20T00%3A32%3A27Z&se=2026-11-20T01%3A32%3A27Z&sr=c&sp=r&sig=K%2BjOvcu7d9QwuxFRQo0%2Brj%2BRbQdcPC9NEjWoTIj%2FwYo%3D) to open the sidebar where you can filter results and view the groupby pie chart. > [!NOTE] > Note > > If there are more than 500 results the pie chart does not render. Refine your query and run the search again. ![TAP_groupby_scap.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-c8a63d44-1e41-e4f9-7514-4343f86f7083.png?sv=2026-02-06&spr=https&st=2026-11-20T00%3A32%3A27Z&se=2026-11-20T01%3A32%3A27Z&sr=c&sp=r&sig=K%2BjOvcu7d9QwuxFRQo0%2Brj%2BRbQdcPC9NEjWoTIj%2FwYo%3D) **Groupby Syntax** ``` mql query [directives] | groupby [] [] [] ``` | `<order>` | Controls the order of the results. Must be > (descending order) or < (ascending order). When using a key/value syntax, the strings “desc” or “asc” are also acceptable. Descending order will show the most frequent occurrences; ascending order will show the least. | | --- | --- | | `<field>` | A field used in your environment. `<field>` can be any string composed of letters, numbers, and special characters that designate a field used in your environment. You may also specify a set of fields by enclosing them in brackets ( [] ). When doing so, the `groupby` will be performed on tuples created from the values indicated by the fields. | | `<limit>` | Integer. Designates the maximum number of results to show. This argument is optional. | | `<threshold>` | Integer. Designates a minimum count threshold. This argument is optional. | > [!NOTE] > Note > > TQL was previously called *MQL*. You still use and see `mql` in TQL queries. **Examples** | Query | Result | | --- | --- | | `rawmsg:* \| groupby srcipv4 10 1000` | The top ten `srcipv4` values that have at least 1000 occurrences. See above screenshot. | | `tcp \| groupby dstport 10 1000` | The 10 most frequent ports that also have counts greater than 1000. | | `tcp \| groupby < srcipv4 100` | The 100 least frequent `srcipv4` values. | | `tcp \| groupby > srcipv4 10` | The 10 most frequent `srcipv4` values. | | `tcp \| groupby > [srcipv4,dstipv4] 10` | The 10 most frequent unique `srcipv4_dstipv4` tuples. |