forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing docs for copy_fields and truncate_fields
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[[copy-fields]] | ||
=== Copy fields | ||
|
||
The `copy_fields` processor copies a field to another one. | ||
|
||
`fields`:: List of `from` and `to` pairs to copy from and to. | ||
`fail_on_error`:: (Optional) If set to true, in case of an error the changes to | ||
the event are reverted, and the original event is returned. If set to `false`, | ||
processing continues also if an error happens. Default is `true`. | ||
`ignore_missing`:: (Optional) Whether to ignore events which lack the source | ||
field. The default is `false`, which will fail processing of | ||
an event if a field is missing. | ||
|
||
For example, this configuration: | ||
|
||
[source,yaml] | ||
------------------------------------------------------------------------------ | ||
processors: | ||
- copy_fields: | ||
fields: | ||
- from: message | ||
to: event.original | ||
fail_on_error: false | ||
ignore_missing: true | ||
------------------------------------------------------------------------------ | ||
|
||
Copies the original `message` field to `event.original`: | ||
|
||
[source,json] | ||
------------------------------------------------------------------------------- | ||
{ | ||
"message": "my-interesting-message", | ||
"event": { | ||
"original": "my-interesting-message" | ||
} | ||
} | ||
------------------------------------------------------------------------------- | ||
|
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,29 @@ | ||
[[truncate-fields]] | ||
=== Truncate fields | ||
|
||
The `truncate_fields` truncates a field to a given size if bigger. If the size of the field is smaller than | ||
the limit, the field is left as is. | ||
|
||
`fields`:: List of `from` and `to` pairs to copy from and to. | ||
`max_bytes`:: Maximum number of bytes in a field. Mutually exclusive with `max_characters`. | ||
`max_characters`:: Maximum number of characters in a field. Mutually exclusive with `max_bytes`. | ||
`fail_on_error`:: (Optional) If set to true, in case of an error the changes to | ||
the event are reverted, and the original event is returned. If set to `false`, | ||
processing continues also if an error happens. Default is `true`. | ||
`ignore_missing`:: (Optional) Whether to ignore events which lack the source | ||
field. The default is `false`, which will fail processing of | ||
an event if a field is missing. | ||
|
||
For example, this configuration truncates the field named `message` to 5 characters: | ||
|
||
[source,yaml] | ||
------------------------------------------------------------------------------ | ||
processors: | ||
- truncate_fields: | ||
fields: | ||
- message | ||
max_characters: 5 | ||
fail_on_error: false | ||
ignore_missing: true | ||
------------------------------------------------------------------------------ | ||
|