1.5 KiB
1.5 KiB
005 — FilterBar query language (pest grammar)
Summary
Build the syntax-aware search language described in the README's FilterBar section,
using pest, supporting regex searches and metric comparisons combined with
boolean operators.
Scope
- Add
pest+pest_derivedependencies. - Grammar covering:
regex("...")— raw-text regex search over log lines.metric_name[param] <op> valuecomparisons (<,>,<=,>=,==,!=) —metric_name[param]<5per the README example.sequenceandtimestampas reserved metric names usable the same way (sequence<5,timestamp>12:00).- Boolean combinators
and/orwith standard precedence, e.g.regex("error") and sequence<5 or timestamp>12:00.
- Parse into an AST (not directly into engine queries — that's 007).
- Surface parse errors with position info suitable for showing under the FilterBar input.
Acceptance criteria
- Grammar test cases cover: bare regex, single metric comparison, reserved-metric
comparison,
and/orcombinations with correct precedence, and at least one malformed-input case producing a located error rather than a panic. - Parser is a standalone module with no dependency on the engine/index types, so it can be unit tested in isolation.
Depends on
None directly, but the metric-comparison side of the grammar is only meaningful once 002 exists — build/test this ticket against metric names as opaque strings.