From c6af640798cbac19ebd3226e8fcd266115d6cd78 Mon Sep 17 00:00:00 2001 From: Aditya C S Date: Mon, 16 May 2022 20:00:27 +0530 Subject: [PATCH] feat: support simple selection of labels in json expr parser (#6151) --- docs/sources/logql/log_queries.md | 12 + pkg/logql/syntax/expr.y | 1 + pkg/logql/syntax/expr.y.go | 539 ++++++++++++++++++++---------- pkg/logql/syntax/parser_test.go | 12 + 4 files changed, 396 insertions(+), 168 deletions(-) diff --git a/docs/sources/logql/log_queries.md b/docs/sources/logql/log_queries.md index f458250ecd0e..55d34ac69b9a 100644 --- a/docs/sources/logql/log_queries.md +++ b/docs/sources/logql/log_queries.md @@ -364,6 +364,18 @@ The **json** parser operates in two modes: "server_list" => `["129.0.1.1","10.2.1.3"]` "headers" => `{"Accept": "*/*", "User-Agent": "curl/7.68.0"}` ``` + + If the label to be extracted is same as the original JSON field, expression can be written as just `| json