This repository has been archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change from logger_name to scope_name
- Loading branch information
1 parent
d9940bb
commit e90c940
Showing
21 changed files
with
190 additions
and
190 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## Scope Name Parsing | ||
|
||
A Scope Name may be parsed from a log entry in order to indicate the code from which a log was emitted. | ||
|
||
### `scope_name` parsing parameters | ||
|
||
Parser operators can parse a scope name and attach the resulting value to a log entry. | ||
|
||
| Field | Default | Description | | ||
| --- | --- | --- | | ||
| `parse_from` | required | The [field](/docs/types/field.md) from which the value will be parsed. | | ||
| `preserve_to` | | Preserves the unparsed value at the specified [field](/docs/types/field.md). | | ||
|
||
|
||
### How to use `scope_name` parsing | ||
|
||
All parser operators, such as [`regex_parser`](/docs/operators/regex_parser.md) support these fields inside of a `scope_name` block. | ||
|
||
If a `scope_name` block is specified, the parser operator will perform the parsing _after_ performing its other parsing actions, but _before_ passing the entry to the specified output operator. | ||
|
||
|
||
### Example Configurations | ||
|
||
#### Parse a scope_name from a string | ||
|
||
Configuration: | ||
```yaml | ||
- type: regex_parser | ||
regexp: '^(?P<scope_name_field>\S*)\s-\s(?P<message>.*)' | ||
scope_name: | ||
parse_from: body.scope_name_field | ||
``` | ||
<table> | ||
<tr><td> Input entry </td> <td> Output entry </td></tr> | ||
<tr> | ||
<td> | ||
```json | ||
{ | ||
"resource": { }, | ||
"attributes": { }, | ||
"body": "com.example.Foo - some message", | ||
"scope_name": "", | ||
} | ||
``` | ||
|
||
</td> | ||
<td> | ||
|
||
```json | ||
{ | ||
"resource": { }, | ||
"attributes": { }, | ||
"body": { | ||
"message": "some message", | ||
}, | ||
"scope_name": "com.example.Foo", | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.