Skip to content

Values

An OQL query is built around the value or values. Values represent the item property for witch we are looking for.

Warning

The value type must match with the operator and field elements, otherwise the search results either in an error or comes up as invalid. For example, you can only use string values when using the CONTAINS operator.

String

A string can be any sequence of characters as long as it is between the double quotes ("")

string_field = "string value with space"

String values must be quoted even if they do not contain embedded spaces.

Tip

You can use strings to represent regex characters when searching with the matches or not matches operators.

Integer number

Integers are whole numbers, any number belongs here as long as it does not contain a decimal point.

int_field = 33 OR int_field = -33

Real (float) number

Float numbers include almost all conceivable types of numbers (including fractions and irrational numbers), except for complex numbers.

float_field = 33.32 OR float_field = -33.33

UUID

UUIDs are special string values; put them between quotation marks to define them:

id = "123e4567-e89b-12d3-a456-426614174000"

Symbols

Symbols represent enums and can be specified without quotations:

severity = HIGH

Boolean

Boolean values are either TRUE or FALSE:

bool_field = TRUE AND other_bool_field = FALSE

Null value

NULL is a special value which you can use with the = (equals) or with the != (not equals) operators to test if a given field is set or not.

any_field = NULL OR other_field != NULL

Note

An empty string ("") is not equal to the NULL value.

Vector

Vectors are special value types that can include multiple values. You can only use vector values with the IN or NOT IN operators. To define a vector value, put it in parentheses; if there are multiple values separate them with a ,.

Vectors can include any other basic value type:

int_field IN (3, 4) AND string_field IN ("alpha", "beta")
AND severity IN (HIGH, CRITICAL)

You can also define a single value:

int_field IN (42)