A quick overview of TSL syntax, operators, literals and identifiers.
- Expressions combine identifiers, literals, operators and parentheses:
(field1 = 'value' OR field2 > 10) AND NOT field3 IN [1,2,3]
- Start with a letter or underscore, may include letters, digits,
_
,.
,/
,-
- Array suffixes:
[index]
,[*]
,[name]
- Examples:
name user.age pods[0].status services[my.service].ip
- String:
'text'
,"text"
,`text`
- Numeric: integer, decimal, scientific, with optional SI suffix (
Ki
,M
, etc.) - Date/Time:
YYYY-MM-DD
or RFC3339YYYY-MM-DDThh:mm:ssZ
- Boolean:
true
,false
- Null:
null
- Arrays:
[expr, expr, ...]
- Logical
AND
,OR
,NOT
- Comparison
=
,!=
,<
,<=
,>
,>=
- Pattern
LIKE
,ILIKE
(case‑insensitive),~=
(regex match),~!
(regex not match)
- Membership
IN
,NOT IN
,BETWEEN … AND …
- Arithmetic
+
,-
,*
,/
,%
- Array functions
LEN x
,ANY x
,ALL x
,SUM x
- Unary:
NOT
,LEN
,ANY
,ALL
,SUM
, unary-
*
,/
,%
+
,-
IN
,BETWEEN
,LIKE
,ILIKE
,IS
, etc.- Comparisons:
=
,!=
,<
,<=
,>
,>=
,~=
,~!
AND
OR
# combine filters
(name LIKE '%joe%' OR city = 'milan') AND age BETWEEN 20 AND 30
# array operations
tags IN ['a','b','c']
SUM scores > 100
ANY (values > 5)
# date comparison
created_at >= '2021-01-01T00:00:00Z'