Trill reference
A Trill query is a list of terms separated by spaces. An event matches when it satisfies every term: terms are combined with AND, and order doesn’t matter.
Terms at a glance
Section titled “Terms at a glance”| Term | Matches | Example |
|---|---|---|
word |
the message contains word |
timeout |
"a phrase" |
the message contains the phrase | "connection refused" |
-word |
the message does not contain word |
-healthcheck |
level:<name> |
exactly this level | level:error |
level>=<name> |
this level or worse (also >, <, <=) |
level>=warn |
service:<name> |
this service | service:checkout |
env:<name> |
this environment | env:prod |
key:<id> |
ingested by this API key | key:0190f3a2-7c4e-7a11-9b65-2f1d8e6a4c30 |
field.<path>:<value> |
a field equals the value | field.imei:864351050000101 |
field.<path>>=<n> |
a numeric field compares (also >, <, <=) |
field.status>=500 |
field.<path>:* |
the field exists | field.error:* |
-field.<path>:<value> |
the field does not equal the value (also works with >, >=, <, <=, :*) |
-field.reason:duplicate |
in:fields, in:all |
free text also searches field keys and values | in:fields timeout |
Free text
Section titled “Free text”A bare word or a quoted phrase matches events whose message contains it:
timeout"connection refused"'heart beat'- Case doesn’t matter.
Timeout,timeout, andTIMEOUTare the same term. - Quotes group words. Use double or single quotes. There’s no escape character:
to search for a
", wrap the phrase in single quotes, and the other way round. - Prefix
-to exclude.-healthcheckdrops every event whose message contains it;-"connection refused"excludes a phrase.
How a term matches depends on the server’s search index:
KINGLET_SEARCH |
time finds |
Notes |
|---|---|---|
substring (default) |
timeout, runtime, timestamp |
Any position. Terms shorter than 3 characters scan the window. |
words |
timeout, timestamp, not runtime |
Whole words and word prefixes (stored queries only; live tail and match monitors always match substrings). |
off |
timeout, runtime, timestamp |
No index; every text term scans the window. |
Levels, least to most severe: trace, debug, info, warn, error, fatal.
level:error exactly errorlevel>=warn warn, error, fatallevel<info trace, debugThe operators are : (or =), >, >=, <, and <=. Level names ignore case.
Service, environment, and API key
Section titled “Service, environment, and API key”service:checkoutenv:prodservice:"billing worker"key:0190f3a2-7c4e-7a11-9b65-2f1d8e6a4c30serviceandenvmatch the whole name. Kinglet stores both in lowercase at ingest, and Trill compares them the same way, soservice:APIandservice:apiare equal.key:<id>(orapi_key:<id>) matches events ingested by that API key. Hover a key’s token prefix in Settings → Projects → manage → keys to copy its UUID, or click View usage in the key menu (for app keys). It needs the full UUID; a shortened id is searched as free text.- One of each. A query holds one
service, oneenv, onekey, and onelevelcondition. If you write two, the last one wins.
Field filters
Section titled “Field filters”When an event is sent with fields, field.<path> filters on them:
{ "message": "RUPTELA 864351050000101 · 3 records saved", "fields": { "imei": "864351050000101", "savedCount": 3, "durationMs": 1450, "ack": true, "data": { "rss": 251 } }}field.imei:864351050000101 equalsfield.savedCount>=1 number comparisonfield.data.rss>250 nested keyfield.ack:true booleanfield.error:* the field exists, whatever its value-field.reason:"already saved" does not equal- Write the key after lowercase
field.(fields.works too; uppercase likeFIELD.falls back to free text). Join nested keys with dots, up to 4 levels and 64 characters per segment:field.data.rss. - Keys may contain letters, digits,
_, and-, and are case-sensitive:field.durationMsandfield.durationmsare different keys. Keys with other characters can’t be filtered by name; usein:fieldsinstead.
How values compare
Section titled “How values compare”| Operator | Behaviour |
|---|---|
: or = |
Equals. Compares the value as text, ignoring case: field.protocol:ruptela matches "RUPTELA", field.savedCount:3 matches 3. |
> >= < <= |
Numeric. Only matches fields that are JSON numbers: a number stored as a string ("500") doesn’t match. |
:* or =* |
Exists. Matches any value, including null, objects, and arrays. |
- prefix |
Negates (-field.a:b, -field.status>=500, -field.error:*). Also keeps events that don’t have the field at all. |
true,false, andnullmatch JSON booleans and null by name.- Empty-string equality (
field.foo:"") is not supported and falls back to free text; usefield.foo:*to check existence. - An event without the field never matches a positive filter.
- For objects and arrays, use
:*(exists); equality on them compares their JSON text.
Search scope: in:
Section titled “Search scope: in:”By default, free text searches only the message. in: changes that for every
free-text term in the query:
| Term | Free text searches |
|---|---|
in:message (default) |
the message, through the index |
in:fields |
the fields’ keys and values, as text |
in:all |
the message or the fields |
in:fields timeout any field key or value contains "timeout"in:all 864351050000101 the message or a field contains the IMEIin:all -staging neither the message nor the fields mention "staging"in:fields matches the stored JSON text, so it also finds key names: in:fields imei matches every event with an imei field. It ignores field filters, which
always look at their own key.
Rules worth knowing
Section titled “Rules worth knowing”- AND only. There is no
ORor grouping yet. To see two services, run two searches, or drop the service term and narrow with others. - Last wins. For
level,service,env,key, andin:, the last term of each kind applies. - Unrecognized terms are free text. A term that isn’t valid Trill, like
level>=bogusorfield.status>abc, is searched as plain text. It doesn’t cause an error. - Quotes don’t make text.
"service:api"is still a service filter. - Only text and fields negate.
-level>=warn,-service:api, and-env:prodare treated as text exclusions. Use the opposite comparison instead, such aslevel<warn.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Query length | 500 characters |
| Terms | 32 whitespace-separated words (a two-word quoted phrase counts as 2) |
| Time window | 31 days per search, count, or histogram (defaults to the last hour when omitted); longer ranges clamp to the 31 days before to, and to clamps to 5 minutes ahead. Live tail and clearing have no window limit. |
| Field depth | 4 levels (field.a.b.c.d), 64 characters per segment |