Introducing KQL's scalar operators
It is impossible to cover all of KQL's operators and functions in one chapter. But in this section, we will learn about some of the common operators. We will introduce more operators and functions throughout the rest of the book.
KQL also supports arithmetic, logical, and relational operators. Let's quickly review these operators, beginning with the arithmetic operators, before diving into searching and filtering, since they are commonly used in queries.
Arithmetic operators
The arithmetic operators allow us to perform calculations on numbers and dates. We can use the print
operator to print strings and the result of expressions.
Table 5.4 lists the operators in order of precedence:
The following print
statement prints the result of 550 + 5
, which is 555
.
print 550 + 5
Using the parentheses, we can override the operator precedence...