diff --git a/clients/pkg/logentry/stages/match_test.go b/clients/pkg/logentry/stages/match_test.go index ebaf7d5a9f..558407320c 100644 --- a/clients/pkg/logentry/stages/match_test.go +++ b/clients/pkg/logentry/stages/match_test.go @@ -126,6 +126,7 @@ func TestMatcher(t *testing.T) { {`{foo="bar",bar!~"te.*"}`, map[string]string{"foo": "bar", "bar": "test"}, MatchActionDrop, false, false, false}, {`{foo=""}`, map[string]string{}, MatchActionKeep, false, true, false}, + {`{foo="bar"} |= "foo" | status >= 200`, map[string]string{"foo": "bar"}, MatchActionKeep, false, false, true}, } for _, tt := range tests { diff --git a/docs/sources/clients/promtail/stages/match.md b/docs/sources/clients/promtail/stages/match.md index 4ae2aa5b1b..50dd06aed8 100644 --- a/docs/sources/clients/promtail/stages/match.md +++ b/docs/sources/clients/promtail/stages/match.md @@ -5,14 +5,19 @@ description: match stage # match The match stage is a filtering stage that conditionally applies a set of stages -or drop entries when a log entry matches a configurable [LogQL]({{< relref "../../../query" >}}) -stream selector and filter expressions. +or drop entries when a log entry matches a configurable LogQL +[stream selector]({{< relref "../../../query/log_queries#log-stream-selector" >}}) and +[filter expressions]({{< relref "../../../query/log_queries#line-filter-expression" >}}). + +{{% admonition type="note" %}} +The filters do not include label filter expressions such as `| label == "foobar"`. +{{% /admonition %}} ## Schema ```yaml match: - # LogQL stream selector and filter expressions. + # LogQL stream selector and line filter expressions. selector: # Names the pipeline. When defined, creates an additional label in