Skip to content

Trill

Trill is how you ask Kinglet for events. A Trill query is a list of terms separated by spaces, and an event matches when it satisfies every term:

level>=warn service:api timeout -healthcheck

That reads as: warnings or worse, from the api service, whose message contains “timeout” but not “healthcheck”.

The same query works everywhere Kinglet takes a filter:

  • The log view. The search bar, with autocomplete, the live tail, and the volume histogram.
  • The API. The q parameter on GET /v1/events, /v1/aggregate, /v1/histogram, and the /v1/stream live tail.
  • Monitors. A monitor’s query decides which events it counts or alerts on.
  • Clearing logs. Delete exactly the events a query matches, after a preview.
  • The MCP server. AI clients search and count with the same syntax.
You want Trill
Errors and worse level>=error
One service, one environment service:checkout env:prod
Messages containing a phrase "connection refused"
…but not health checks "connection refused" -healthcheck
A value in the event’s structured fields field.orderId:A-42
Slow requests field.durationMs>1000
Anything mentioning a value, message or fields in:all 864351050000101

Terms combine freely, in any order: service:udp level>=warn field.imei:8643….

Every Kinglet event has a message (the text line) and optional fields (a JSON object sent alongside it). Trill searches both, in different ways:

  • Free text like timeout or "conn refused" matches the message, through the search index when one exists.
  • Field filters like field.status>=500 target specific keys in fields by value, numeric comparison, or existence.
  • in:fields or in:all makes free text search the fields’ keys and values too, for when you don’t know which field holds what you’re after.

Field filters and in:fields scan the events in the selected project and time window instead of using the index. That’s about 0.1 s for a day of a 1M-event project, and a few seconds for two weeks. Narrow the window, or add service:, level, or message text, to keep them fast.