Skip to content

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.

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

A bare word or a quoted phrase matches events whose message contains it:

timeout
"connection refused"
'heart beat'
  • Case doesn’t matter. Timeout, timeout, and TIMEOUT are 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. -healthcheck drops 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 error
level>=warn warn, error, fatal
level<info trace, debug

The operators are : (or =), >, >=, <, and <=. Level names ignore case.

service:checkout
env:prod
service:"billing worker"
key:0190f3a2-7c4e-7a11-9b65-2f1d8e6a4c30
  • service and env match the whole name. Kinglet stores both in lowercase at ingest, and Trill compares them the same way, so service:API and service:api are equal.
  • key:<id> (or api_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, one env, one key, and one level condition. If you write two, the last one wins.

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 equals
field.savedCount>=1 number comparison
field.data.rss>250 nested key
field.ack:true boolean
field.error:* the field exists, whatever its value
-field.reason:"already saved" does not equal
  • Write the key after lowercase field. (fields. works too; uppercase like FIELD. 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.durationMs and field.durationms are different keys. Keys with other characters can’t be filtered by name; use in:fields instead.
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, and null match JSON booleans and null by name.
  • Empty-string equality (field.foo:"") is not supported and falls back to free text; use field.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.

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 IMEI
in: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.

  • AND only. There is no OR or 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, and in:, the last term of each kind applies.
  • Unrecognized terms are free text. A term that isn’t valid Trill, like level>=bogus or field.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:prod are treated as text exclusions. Use the opposite comparison instead, such as level<warn.
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