--- title: "Boolean Operators" slug: "boolean-operators-4" tags: ["Install and Get Started", "NDR 4.x", "Customer", "Network Security"] updated: 2026-11-17T09:22:39Z published: 2026-11-17T09:22:39Z canonical: "docs.trellix.com/boolean-operators-4" --- > ## 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. # Boolean Operators Boolean operators combine terms through logic operators. NDR supports **OR**, **AND**, “**+**”, **NOT** and “**-**” as Boolean operators. Use the same steps defined in the [Entering Queries](/network-and-platform/docs/entering-queries-2) section to create and run queries using Boolean Operators. > [!NOTE] > Note > > Boolean operators must be ALL CAPS. **OR Operator** The **OR** operator links two terms and finds matching documents that contain either term. This is equivalent to a union using sets. You can also use the **||** symbol in place of the word **OR**. > [!NOTE] > Note > > If there is no Boolean operator between two field filters, terms, or values, NDR search uses the **OR** operator as the default conjunction operator. To search for documents that contain either a **destinationTransportPort** of 80 or a **doc_values_type** of pxflow, enter one of the following queries: ![OR Operator_pxflow.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-751b651b-6fb2-6f0b-d259-47ace324d480(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) or ![OR Operator_pxflow02.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-7e0c8aaf-e37e-74c3-5a58-d5361df5f42e(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) To construct a query for an advanced search using the **OR** operator, apply the following search syntax rules: - Use the **querystring** search syntax to construct the query. - Use double quotes around your term or value. - Separate your field filters or terms with the **OR** operator. For example, if you want to retrieve sessions with either a **destinationTransportPort** of 443 **OR** 25 **AND** a **doc_values_type** of fileinfo, enter the following query: ![Advanced OR Query.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-5a98a5b5-9aac-dec6-af54-f827275567e9(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) **AND Operator** The **AND** operator matches documents where both terms exist anywhere in the document text. This is equivalent to an intersection using sets. The symbol **&&** can be used in place of the word **AND**. For example, to search for documents that contain “ASCII” and “CLOSED”, enter the text query followed by the Esc key and Enter: ![AND OPERATOR02.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-20956cf2-0dea-5ddf-2df1-e47da1617862(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) > [!NOTE] > Note > > The **TEXT:** filter acts as a catchall filter for unstructured text. > > Pressing the Esc key after entering a text query prevents the NDR search from automatically generating a Structured-Pill that overwrites your **TEXT:** filter. You can also use the **querystring** syntax and double quotes around the terms to search documents that contain "ASCII" and "CLOSED". ![AND Operator03.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-c94f5075-be3c-4ad6-e58b-3cbe51d21ad5(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) **+ Operator** The “**+**”, or MUST operator, requires that the term after the “**+**” symbol must exist somewhere in the document default field. For example, to search for documents that must contain “ASCII” and **may contain** “CLOSED”, enter the following query: ![ASCII MUST.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-a483d5d5-8aec-6876-fa51-eb99d3a2630d(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) > [!NOTE] > Note > > Always append the "+" and "-" operators to the fieldname or term when used in a query string. To search for documents that must contain “ASCII” and must contain “CLOSED”, enter the following query: ![MUST Operator002.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-ef568b2e-6721-f7b0-fc7a-b040976d921b(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) **NOT Operator** The **NOT** operator excludes sessions that contain the term after NOT. This is equivalent to a difference using sets. The symbol **!** can be used in place of the word NOT. To search for documents that contain “ASCII” but not “CLOSED”, enter the following query: ![NOT Operator01.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-4ec7c853-3cb4-8353-7515-45491d0dd3c6(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D) > [!NOTE] > Note > > The NOT operator cannot be used with just one term. For example, the following search will return no results: **NOT “access granted”**. **- Operator** The “**-**”, or prohibit operator, excludes documents that contain the term after the “**-**” symbol. To search for documents that must contain "ASCII" **AND** "TRUNCATED" but **must exclude** "CLOSED", enter the following query: ![MUST NOT Operator.png](https://cdn.us.document360.io/0d453a50-e1da-4d4a-9409-fea7959614d8/Images/Documentation/uuid-2612f0d9-3d2d-3eff-e36f-dc06ee8ee1d0(4).png?sv=2026-02-06&spr=https&st=2026-11-19T12%3A42%3A32Z&se=2026-11-19T13%3A42%3A32Z&sr=c&sp=r&sig=KRzofKjpHbw9QLD7S8W1l%2BbBFWIu%2Fjf7vy6doOlvsdg%3D)