Search Operators
Advanced search on ThreatStream supports the search operators listed in the table below.
| Operator | Description |
|---|---|
=
|
Searches for results that are identical to the value after the operator. Note: The behavior of the |
!=
|
Searches for results that exclude the value after the operator. |
contains
|
Searches for results that are composed partially or wholly of the value after the operator. Values specified after the Note: The behavior of the |
startswith
|
Searches for results that begin with the value after the operator. |
endswith
|
Searches for results that end with the value after the operator. |
~
|
Searches for results that match the regular expression after the operator. Only valid for use in filter expressions that contain regular expressions.
Note: Avoid using regular expression operators in search queries. As an alternative, use the |
!~
|
Searches for results that do not match the regular expression after the operator. Only valid for use in filter expressions that contain regular expressions. Note: Avoid using regular expression operators in search queries. As an alternative, use the |
insubnet
|
Searches for results that fall within the subnetwork after the operator. See Subnet Queries in Advanced Search for more information. |
!insubnet
|
Searches for results that do not fall within the subnetwork after the operator. See Subnet Queries in Advanced Search for more information. |
<
|
Searches for results that are less than the numerical value or date after the operator. See the Data Types table for additional information about date data types. |
<=
|
Searches for results that are less than or equal to the numerical value or date after the operator. See the Data Types table for additional information about date data types. |
>
|
Searches for results that are greater than the numerical value or date after the operator. See the Data Types table for additional information about date data types. |
>=
|
Searches for results that are greater than or equal to the numerical value or date after the operator. See the Data Types table for additional information about date data types. |
AND
|
Searches for results that are included in both the filter expression before and the filter expression after the operator. |
OR
|
Searches for results that are included in either the filter expression before or the filter expression after the operator. Results included in both filter expressions are also returned. |
NOT
|
Searches for results that are excluded from the filter expression after the operator. |
Each data type is compatible with certain search operators. The table below displays all of the valid operators and fields associated with each data type.
| Data Type | Valid Operators | Field Names |
|---|---|---|
| String | =, !=, contains, startswith, endswith, ~, !~, insubnet, !insubnet |
Note:
|
| Numeric | =, !=, <, <=, >, >= |
confidence, stream_id, import_session_id, owner_id, trusted_circle_ids |
| Date | =, !=, <, <=, >, >= |
Date can be specified as follows:
Note: When values such as 1d or 2w are specified, the search engine automatically interprets them as $NOW-<value> and searches for the appropriate time range. For example,
created_ts >= 1d is interpreted as “created_ts >= $NOW-1d” and returns everything that has a timestamp greater than equal to NOW minus one day (that is, the time range is the last day). Conversely, created_ts <= 1d is interpreted as “created_ts<= $NOW-1d” and returns everything that has a timestamp less than NOW minus one day (that is, everything except the last day). |
| Boolean | =, != |
is_public
|
| Logical | AND, OR, NOT |
Joins together multiple expressions. Example: |