Skip to content

Commit

Permalink
Add a protip to the regex_parser doc (open-telemetry#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
djaglowski authored Jul 21, 2021
1 parent 9bdd080 commit 319fab1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/operators/regex_parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

The `regex_parser` operator parses the string-type field selected by `parse_from` with the given regular expression pattern.

#### Regex Syntax

This operator makes use of [Go regular expression](https://github.com/google/re2/wiki/Syntax). When writing a regex, consider using a tool such as (regex101)[https://regex101.com/?flavor=golang].

### Configuration Fields

| Field | Default | Description |
| --- | --- | --- |
| `id` | `regex_parser` | A unique identifier for the operator |
| `output` | Next in pipeline | The connected operator(s) that will receive all outbound entries |
| `regex` | required | A [Go regular expression](https://github.com/google/re2/wiki/Syntax). The named capture groups will be extracted as fields in the parsed object |
| `regex` | required | A [Go regular expression](https://github.com/google/re2/wiki/Syntax). The named capture groups will be extracted as fields in the parsed body. |
| `parse_from` | `$body` | A [field](/docs/types/field.md) that indicates the field from which values should be parsed |
| `parse_to` | `$body` | A [field](/docs/types/field.md) that indicates the field to which values will be parsed |
| `preserve_to` | | Preserves the unparsed value at the specified [field](/docs/types/field.md) |
Expand Down

0 comments on commit 319fab1

Please sign in to comment.