Skip to content

Boolean Logic

FlyQL uses three boolean operators to combine conditions:

OperatorMeaningExample
andBoth conditions must be truestatus=200 and active
orEither condition can be truelevel=error or level=critical
notNegates an expressionnot archived

not can be combined with and and or:

active and not archived
level=error or not healthy

and binds tighter than or. This means:

a=1 or b=2 and c=3

is parsed as:

a=1 or (b=2 and c=3)

To override precedence, use parentheses explicitly.

Use parentheses to control evaluation order:

(status>=400 or level=error) and service=api

Without parentheses, and would bind tighter:

status>=400 or level=error and service=api
→ status>=400 or (level=error and service=api)

Parentheses can be nested:

(a=1 or b=2) and not (c=3 and d=4)

not applies to the entire group:

not (status=200 and healthy)

This negates the combined condition — true only when either status is not 200 or healthy is false.

not negates any expression — a truthy check, a comparison, or a group:

not active # field is falsy
not status=200 # status is not 200
not (a=1 and b=2) # negates the group
active and not archived # combined with other conditions

Double negation cancels out: not not active is equivalent to active.

# Simple AND
status=200 and service=api
# Simple OR
level=error or level=critical
# Mixed with precedence
status>=400 or level=error and service=api
# Explicit grouping
(status>=400 or level=error) and service=api
# Complex query with negation and grouping
(status>=500 and host=prod*) or (level=error and not service=healthcheck)