Skip to content

Commit 86699bd

Browse files
authored
[chore] Add documenation for severity parser's 'overwrite_with' setting (#35074)
See #35049 (comment)
1 parent 83aa8bf commit 86699bd

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

pkg/stanza/docs/operators/severity_parser.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ The `severity_parser` operator sets the severity on an entry by parsing a value
44

55
### Configuration Fields
66

7-
| Field | Default | Description |
8-
| --- | --- | --- |
9-
| `id` | `severity_parser` | A unique identifier for the operator. |
10-
| `output` | Next in pipeline | The `id` for the operator to send parsed entries to. |
11-
| `parse_from` | required | The [field](../types/field.md) from which the value will be parsed. |
12-
| `on_error` | `send` | The behavior of the operator if it encounters an error. See [on_error](../types/on_error.md). |
13-
| `preset` | `default` | A predefined set of values that should be interpreted at specific severity levels. |
14-
| `mapping` | | A formatted set of values that should be interpreted as severity levels. |
15-
| `if` | | An [expression](../types/expression.md) that, when set, will be evaluated to determine whether this operator should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers. |
16-
7+
| Field | Default | Description |
8+
| --- | --- | --- |
9+
| `id` | `severity_parser` | A unique identifier for the operator. |
10+
| `output` | Next in pipeline | The `id` for the operator to send parsed entries to. |
11+
| `parse_from` | required | The [field](../types/field.md) from which the value will be parsed. |
12+
| `on_error` | `send` | The behavior of the operator if it encounters an error. See [on_error](../types/on_error.md). |
13+
| `preset` | `default` | A predefined set of values that should be interpreted at specific severity levels. |
14+
| `mapping` | | A formatted set of values that should be interpreted as severity levels. |
15+
| `overwrite_with` | `false` | If `true`, the severity text will be set to the [standard short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. |
16+
| `if` | | An [expression](../types/expression.md) that, when set, will be evaluated to determine whether this operator should be used for the given entry. This allows you to do easy conditional parsing without branching logic with routers. |
1717

1818
### Example Configurations
1919

pkg/stanza/docs/types/severity.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ Severity is represented as a number from 1 to 24. The meaning of these severity
88

99
Parser operators can parse a severity and attach the resulting value to a log entry.
1010

11-
| Field | Default | Description |
12-
| --- | --- | --- |
13-
| `parse_from` | required | The [field](../types/field.md) from which the value will be parsed. |
14-
| `preset` | `default` | A predefined set of values that should be interpretted at specific severity levels. |
15-
| `mapping` | | A custom set of values that should be interpretted at designated severity levels. |
16-
11+
| Field | Default | Description |
12+
| --- | --- | --- |
13+
| `parse_from` | required | The [field](../types/field.md) from which the value will be parsed. |
14+
| `preset` | `default` | A predefined set of values that should be interpretted at specific severity levels. |
15+
| `mapping` | | A custom set of values that should be interpretted at designated severity levels. |
16+
| `overwrite_with` | `false` | If `true`, the severity text will be set to the [recommeneded short name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity) corresponding to the severity number. |
17+
18+
Note that by default the severity _text_ will be set to the original value which was interpreted into a severity number. In order to set the severity text to a standard short name (e.g. `ERROR`, `INFO3`, etc.), set `overwrite_with` to `true`.
1719

1820
### How severity `mapping` works
1921

0 commit comments

Comments
 (0)