Skip to content

Commit

Permalink
Add duration filter unit test (#6271)
Browse files Browse the repository at this point in the history
  • Loading branch information
btaani committed May 31, 2022
1 parent 7369b37 commit 50ef4f2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/logql/syntax/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ func TestParse(t *testing.T) {
},
),
},
{
in: `{ foo = "bar" }|logfmt|length>5d`,
exp: newPipelineExpr(
newMatcherExpr([]*labels.Matcher{mustNewMatcher(labels.MatchEqual, "foo", "bar")}),
MultiStageExpr{
newLabelParserExpr(OpParserTypeLogfmt, ""),
newLabelFilterExpr(log.NewDurationLabelFilter(log.LabelFilterGreaterThan, "length", 5*24*time.Hour)),
},
),
},
{
in: `rate({ foo = "bar" }[5d])`,
exp: &RangeAggregationExpr{
Expand Down

0 comments on commit 50ef4f2

Please sign in to comment.