Expand description
CloudWatch Logs filter pattern evaluator used by metric filters.
Supports the documented variants:
- Empty pattern matches everything.
- Quoted phrase: substring match of the literal text inside the quotes.
- Plain string (single token): substring match.
- Space-separated terms: AND match (all terms must appear in the message).
- JSON pattern
{ <expr> }: parses the message as JSON, evaluates a boolean expression with=,!=,>,<,>=,<=,&&,||.
Independent from the simpler matches_filter_pattern helper in
service/mod.rs; metric filters need || plus JSON-path value
extraction for MetricValue = $.field, which the older helper
doesn’t expose.
Array-style patterns ([a, b, c]) match positionally against
whitespace-separated tokens in the message. Each comma-separated
field is either a bare name (always matches that slot), a quoted
string, a literal value for equality, or a comparison =v,
!=v, >=v, <=v, >v, <v. ... is a wildcard that skips any
number of tokens.
IS NULL and free-form regex are out of scope and fail closed.
Functions§
- matches
- Returns true when
messagematches the given filter pattern. - resolve_
metric_ value - Resolve the literal
MetricValuefrom a metric filter transformation.