Skip to main content

Module filter

Module filter 

Source
Expand description

Filter expression grammar for --filter.

Three operators are accepted, deliberately kept small so an agent can emit them without a parser of its own:

FormMeaning
key=valuescalar at key equals value (case sensitive)
key!=valuescalar at key differs from value
key~substringscalar at key contains substring (case folded)

== is accepted as a synonym of = for parity with sibling CLIs. key may be a dotted path (stats.total) to reach a nested scalar. Repeating --filter conjoins the predicates with a logical AND.

Parsing is fail-fast: a malformed expression is rejected before any work is done, so a typo can never be mistaken for “no rows matched”.

Structs§

FilterExpr
One parsed --filter predicate.

Enums§

FilterOp
Comparison performed by a single FilterExpr.

Functions§

lookup
Walks a dotted path inside value.
matches_all
Returns true when every predicate accepts element.
resolve
Walks a dotted path given as one unsplit string.
scalar_text
Renders a JSON scalar as the text used for comparison and dedup keys.