From 3a8cf70cc2c2c105d3dbf735c3694322c83116ae Mon Sep 17 00:00:00 2001 From: Tetiana Kravchenko Date: Thu, 10 Mar 2022 14:02:16 +0100 Subject: [PATCH] Documentation about the hints annotation for processors (#30561) * documentation for the hints annotation Signed-off-by: Tetiana Kravchenko * add pr link Signed-off-by: Tetiana Kravchenko --- CHANGELOG.next.asciidoc | 1 + filebeat/docs/autodiscover-hints.asciidoc | 35 +++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index 6d171edc4e39..cd16cdfd8239 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -114,6 +114,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* diff --git a/filebeat/docs/autodiscover-hints.asciidoc b/filebeat/docs/autodiscover-hints.asciidoc index 3488cca2ba24..d4fa08aee3d9 100644 --- a/filebeat/docs/autodiscover-hints.asciidoc +++ b/filebeat/docs/autodiscover-hints.asciidoc @@ -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 <> 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: