Query syntax
Search terms are separated by spaces and ANDed together.
Cheat sheet
| Term | Matches |
| ------------------- | ------------------------------------------- |
| level:error | Exact level; level:>=warn for warn and up |
| err:card_declined | Match a key in attrs |
| customer.id:c_19 | Nested paths with dots |
| latency_ms:>400 | Numeric compare: > >= < <= |
| trace_id:* | Key exists |
| "free text" | Words in the message |
| -env:staging | Exclude anything with a leading dash |
Terms
level:errormatches that level exactly;level:>=warn(also>,<,<=) compares by severity.app:checkoutmatches logs from the app with that slug.host:web-3,env:prod,trace_id:4f1cmatch those fields exactly.status:500orcustomer.country:CAmatches a custom attribute (key.subreaches nested keys); values are compared as text.status:>=500,latency_ms:<250compares an attribute numerically (>,>=,<,<=). Keys may not start with a digit in any segment (a.0is invalid).err:*matches logs where the attribute exists.timeoutor"card declined"searches the message for those words. Words split on anything that is not an ASCII letter or digit, souser_1searchesuserand1; non-ASCII words are matched whole. Free-text search is case-sensitive (timeoutdoes not matchTimeout).-env:stagingor-timeoutnegates a term.
Gotchas
Bare text containing : (such as 12:30) is read as key:value, so quote it ("12:30"). Values with spaces must be quoted (msg:"a b"). Syntax errors report the byte position of the offending term.
Example
level:>=warn app:checkout -env:staging "card declined" status:>=500