Basic operators
Operator | | (pipe, AND
logical operator) |
Description | Add a where clause with a
logical AND, append it using the pipe character (| ). For example, the
query below returns links that are from 192.168.254.0/24 AND going to
172.217.168.0/24. |
Example | links | where from in_subnet? 192.168.254.0/24 | where to in_subnet? 172.217.168.0/24 |
Operator | OR |
Description | To add a where clause with a logical OR,
append it using the OR operator. For example, the query below returns links with
either the http OR the https protocols. |
Example | links | where protocol == http OR protocol == https |
Operator | ! (exclamation point, NOT
logical operator) |
Description | Put an exclamation point (! )
before a term to negate it. For example, the query below returns links that do NOT
(! ) belong to 192.168.254.0/24. |
Example | nodes | where ip !in_subnet? 192.168.254.0/24 | count |
Operator | -> |
Description | To change a column name, select it and use the
-> operator followed by the new name. It is worth noting that
specific suffixes are parsed and used to visualize the column content differently. For
example:
|
Example 1 | nodes | select created_at
created_at->my_integer | where my_integer > 946684800000 |
Example 2 | nodes | select
created_at->my_creation_time |
Example 3 | nodes | select
tcp_retransmission.bytes->my_retrans_bytes |
Operators | == ,
= , < , > ,
<= , and >= |
Description | Queries support the mathematical operators listed above. |
Operator | " (Quotation
marks) |
Description | Use quotation marks
(" ) to specify an empty string. Consider these two cases where this
technique is useful:
|
Example 1 | assets | where os !=
"" |
Example 2 | alerts | select
concat(id_src,"--",id_dst) |
Operator | in? |
Description | in? is only
used with arrays; the field type must be an array. The query looks
for the text strings you specify using in? and returns arrays that
match one of them.The example below uses |
Example | assets | where type
in? ["computer","printer_scanner"] |
Operator | include? |
Description | The query looks for the text
string you specify using include? and returns strings that match
it.The example below uses |
Example | assets | where os
include? Win |