diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index 0241751a4df..bad758c8a3c 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -721,12 +721,30 @@ All processors are defined in the following way within a pipeline definition: // NOTCONSOLE Each processor defines its own configuration parameters, but all processors have -the ability to declare `tag` and `on_failure` fields. These fields are optional. +the ability to declare `tag`, `on_failure` and `if` fields. These fields are optional. A `tag` is simply a string identifier of the specific instantiation of a certain processor in a pipeline. The `tag` field does not affect the processor's behavior, but is very useful for bookkeeping and tracing errors to specific processors. +The `if` field must contain a script that returns a boolean value. If the script evaluates to `true` +then the processor will be executed for the given document otherwise it will be skipped. +The `if` field takes an object with the script fields defined in <> +and accesses a read only version of the document via the same `ctx` variable used by scripts in the +<>. + +[source,js] +-------------------------------------------------- +{ + "set": { + "if": "ctx.bar == 'expectedValue'", + "field": "foo", + "value": "bar" + } +} +-------------------------------------------------- +// NOTCONSOLE + See <> to learn more about the `on_failure` field and error handling in pipelines. The <> can be used to figure out what processors are available in a cluster.