From 435479c294e55c35fb01475c11f440b0c37875a2 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Fri, 10 Nov 2023 15:44:55 +0100 Subject: [PATCH] Update logql.md --- docs/guide/logql.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/guide/logql.md b/docs/guide/logql.md index e178479..1d0aa85 100644 --- a/docs/guide/logql.md +++ b/docs/guide/logql.md @@ -147,7 +147,7 @@ We can use operations on both the log **stream selectors** and **filter expressi ### ** Parser Expression ** Parser expressions can parse and extract labels from the log content. Those extracted labels can then be used for filtering using label filter expressions or for metric aggregations. -#### `json` +### json The json parser operates in two modes: * without parameters: @@ -158,10 +158,14 @@ The json parser operates in two modes: * Using `| json label="expression"` in your pipeline will extract only the specified json fields to labels. * ```{job="0.6611336793589486_json"} | json my_field="json_field"``` -#### `logfmt` -The logfmt parser extracts any key=value pairs from the processed logs. +### logfmt +The logfmt parser extracts any `key=value` pairs from the processed logs. -#### `regexp` +``` +YYYY-MM-DDT00:00:00Z ... name=qryn value=123 something=else +``` + +### regexp The regexp parser operates against log string and requires named groups for matching. Example: extract a new label named `token` from a string ie: