Skip to content

Commit

Permalink
Update logql.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Nov 10, 2023
1 parent c1a7ec3 commit 435479c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/guide/logql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 435479c

Please sign in to comment.