Uh oh!
There was an error while loading. Please reload this page.
docs(skills): LogsQL clause-order and _time iron rules on the monit-query card - #154
docs(skills): LogsQL clause-order and _time iron rules on the monit-query card#154ysyneu wants to merge 1 commit into
Conversation
…uery card The monit-query card teaches `data --expr` by example for PromQL and Loki but names LogsQL only as a routing keyword, so a VictoriaLogs query gets written with SQL/PromQL/Loki habits and comes back 422 on syntax alone. Two dialect rules that differ from every other backend the card covers: - `stats` takes `by (...)` BEFORE the aggregate: `| stats by (level) count() n`. Trailing `by` — the SQL/PromQL/Loki form — is a parse error, so the retry that only changes the aggregate spelling fails identically. - `_time:` accepts a duration or a bracketed range (`_time:[<rfc3339>, <rfc3339>]`), never a slash range, and never an abbreviated date. Both are stated with the exact rejected forms and the error text they produce, plus a LogsQL worked example alongside the existing Loki one.
ysyneu
commented
Aug 20, 2026
Closing — this card no longer reaches a reader.
The |
Why
skills/flashduty/reference/monit-query.mdteachesmonit-query data --exprby example for PromQL and Loki, but LogsQL appears only as a routing keyword in "Route here when". A VictoriaLogs query therefore gets written with SQL/PromQL/Loki habits and is rejected by the datasource on syntax alone — and because the rejection is a parse error rather than a semantic one, retries that only reword the aggregate fail identically.What
Two gotcha bullets plus a LogsQL worked example:
statsputsby (...)before the aggregate —| stats by (level) count() n. The trailing-byforms (| stats count(*) by (level),| stats count() by level,| stats count(*) as n by level) all fail withcannot parse 'stats' pipe: unexpected token ... after [count(*)]. Multi-key and no-byglobal aggregate shapes are given too, along with the ordinary downstream pipes (sort,limit,filter)._time:takes a duration or a bracketed range —_time:1h,_time:[<rfc3339>, <rfc3339>]. Slash ranges and abbreviated dates fail withcannot parse duration at _time filter.Every accepted and rejected form in the text was executed against a live VictoriaLogs instance before being written down.
Verification
go build ./...cleango test ./...— all packages pass (incl.internal/skilldoc)