Skip to content

Commit

Permalink
Extend json label extraction test
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Jun 12, 2022
1 parent 5206e3a commit 711a372
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/logql/syntax/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2944,13 +2944,14 @@ func TestParse(t *testing.T) {
},
},
{
in: `{app="foo"} | json response_code, api_key="request.headers[\"X-API-KEY\"]"`,
in: `{app="foo"} | json response_code, api_key="request.headers[\"X-API-KEY\"]", layer7_something_specific="layer7_something_specific"`,
exp: &PipelineExpr{
Left: newMatcherExpr([]*labels.Matcher{{Type: labels.MatchEqual, Name: "app", Value: "foo"}}),
MultiStages: MultiStageExpr{
newJSONExpressionParser([]log.JSONExpression{
log.NewJSONExpr("response_code", `response_code`),
log.NewJSONExpr("api_key", `request.headers["X-API-KEY"]`),
log.NewJSONExpr("layer7_something_specific", `layer7_something_specific`),
}),
},
},
Expand Down

0 comments on commit 711a372

Please sign in to comment.