Skip to content

Commit

Permalink
Documentation about the hints annotation for processors (#30561) (#30768
Browse files Browse the repository at this point in the history
)

* documentation for the hints annotation

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>

* add pr link

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
(cherry picked from commit 3a8cf70)

Co-authored-by: Tetiana Kravchenko <tetiana.kravchenko@elastic.co>
  • Loading branch information
mergify[bot] and tetianakravchenko authored Mar 14, 2022
1 parent 6e68c2a commit e586e0f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...main[Check the HEAD dif

*Filebeat*

- Extend documentation about hints annotation for processors {pull}30561[30561]

*Heartbeat*

Expand Down
35 changes: 35 additions & 0 deletions filebeat/docs/autodiscover-hints.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,41 @@ co.elastic.logs/raw: "[{\"containers\":{\"ids\":[\"${data.container.id}\"]},\"mu
Define a processor to be added to the {beatname_uc} input/module configuration. See <<filtering-and-enhancing-data>> for the list
of supported processors.

If processors configuration uses list data structure, object fields must be enumerated.
For example, hints for the `rename` processor configuration below
[source,yaml]
-----
processors:
- rename:
fields:
- from: "a.g"
to: "e.d"
fail_on_error: true
-----
will look like:
[source,yaml]
-----
co.elastic.logs/processors.rename.fields.0.from: "a.g"
co.elastic.logs/processors.rename.fields.1.to: "e.d"
co.elastic.logs/processors.rename.fail_on_error: 'true'
-----

If processors configuration uses map data structure, enumeration is not needed. For example, the equivalent to the `add_fields` configuration below
[source,yaml]
-----
processors:
- add_fields:
target: project
fields:
name: myproject
-----
is
[source,yaml]
-----
co.elastic.logs/processors.1.add_fields.target: "project"
co.elastic.logs/processors.1.add_fields.fields.name: "myproject"
-----

In order to provide ordering of the processor definition, numbers can be provided. If not, the hints builder will do
arbitrary ordering:

Expand Down

0 comments on commit e586e0f

Please sign in to comment.