Skip to content

Commit 3a59d5e

Browse files
committed
ingest: add common options to each processor's documentation (#35091)
* adds `if`, `on_failure`, `tag`, and `ignore_failure` to table for each processor part of #33188 * added ingore_failure * fix whitespace noise
1 parent 9dc2f1a commit 3a59d5e

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| `if` | no | - | Conditionally execute this processor.
2+
| `on_failure` | no | - | Handle failures for this processor. See <<handling-failure-in-pipelines>>.
3+
| `ignore_failure` | no | `false` | Ignore failures for this processor. See <<handling-failure-in-pipelines>>.
4+
| `tag` | no | - | An identifier for this processor. Useful for debugging and metrics.
5+
// TODO: See <<ingest-conditionals>>. <-- for the if description once PR 35044 is merged

docs/reference/ingest/ingest-node.asciidoc

+33-2
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ Accepts a single value or an array of values.
778778
| Name | Required | Default | Description
779779
| `field` | yes | - | The field to be appended to. Supports <<accessing-template-fields,template snippets>>.
780780
| `value` | yes | - | The value to be appended. Supports <<accessing-template-fields,template snippets>>.
781+
include::ingest-node-common-processor.asciidoc[]
781782
|======
782783

783784
[source,js]
@@ -806,6 +807,7 @@ the field is not a supported format or resultant value exceeds 2^63.
806807
| `field` | yes | - | The field to convert
807808
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
808809
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
810+
include::ingest-node-common-processor.asciidoc[]
809811
|======
810812

811813
[source,js]
@@ -844,6 +846,7 @@ still be updated with the unconverted field value.
844846
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
845847
| `type` | yes | - | The type to convert the existing value to
846848
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
849+
include::ingest-node-common-processor.asciidoc[]
847850
|======
848851

849852
[source,js]
@@ -876,6 +879,7 @@ in the same order they were defined as part of the processor definition.
876879
| `formats` | yes | - | An array of the expected date formats. Can be a Joda pattern or one of the following formats: ISO8601, UNIX, UNIX_MS, or TAI64N.
877880
| `timezone` | no | UTC | The timezone to use when parsing the date. Supports <<accessing-template-fields,template snippets>>.
878881
| `locale` | no | ENGLISH | The locale to use when parsing the date, relevant when parsing month names or week days. Supports <<accessing-template-fields,template snippets>>.
882+
include::ingest-node-common-processor.asciidoc[]
879883
|======
880884

881885
Here is an example that adds the parsed date to the `timestamp` field based on the `initial_date` field:
@@ -1065,6 +1069,7 @@ understands this to mean `2016-04-01` as is explained in the <<date-math-index-n
10651069
| `timezone` | no | UTC | The timezone to use when parsing the date and when date math index supports resolves expressions into concrete index names.
10661070
| `locale` | no | ENGLISH | The locale to use when parsing the date from the document being preprocessed, relevant when parsing month names or week days.
10671071
| `index_name_format` | no | yyyy-MM-dd | The format to be used when printing the parsed date into the index name. An valid Joda pattern is expected here. Supports <<accessing-template-fields,template snippets>>.
1072+
include::ingest-node-common-processor.asciidoc[]
10681073
|======
10691074

10701075
[[dissect-processor]]
@@ -1134,7 +1139,7 @@ See <<dissect-key-modifiers, below>> for more information.
11341139
| `pattern` | yes | - | The pattern to apply to the field
11351140
| `append_separator`| no | "" (empty string) | The character(s) that separate the appended fields.
11361141
| `ignore_missing` | no | false | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
1137-
| `
1142+
include::ingest-node-common-processor.asciidoc[]
11381143
|======
11391144

11401145
[source,js]
@@ -1162,7 +1167,6 @@ modifiers.
11621167
| `+` with `/n` | Append with order | left and right | `%{+keyname/2} %{+keyname/1}` | Appends two or more fields together in the order specified | <<dissect-modifier-append-key-with-order,link>>
11631168
| `?` | Named skip key | left | `%{?ignoreme}` | Skips the matched value in the output. Same behavior as `%{}`| <<dissect-modifier-named-skip-key,link>>
11641169
| `*` and `&` | Reference keys | left | `%{*r1} %{&r1}` | Sets the output key as value of `*` and output value of `&` | <<dissect-modifier-reference-keys,link>>
1165-
| `
11661170
|======
11671171

11681172
[[dissect-modifier-skip-right-padding]]
@@ -1265,6 +1269,14 @@ Reference key modifier example
12651269
Drops the document without raising any errors. This is useful to prevent the document from
12661270
getting indexed based on some condition.
12671271

1272+
[[drop-options]]
1273+
.Drop Options
1274+
[options="header"]
1275+
|======
1276+
| Name | Required | Default | Description
1277+
include::ingest-node-common-processor.asciidoc[]
1278+
|======
1279+
12681280
[source,js]
12691281
--------------------------------------------------
12701282
{
@@ -1289,6 +1301,7 @@ Otherwise these <<accessing-data-in-pipelines,fields>> can't be accessed by any
12891301
| Name | Required | Default | Description
12901302
| `field` | yes | - | The field to expand into an object field
12911303
| `path` | no | - | The field that contains the field to expand. Only required if the field to expand is part another object field, because the `field` option can only understand leaf fields.
1304+
include::ingest-node-common-processor.asciidoc[]
12921305
|======
12931306

12941307
[source,js]
@@ -1406,6 +1419,7 @@ to the requester.
14061419
|======
14071420
| Name | Required | Default | Description
14081421
| `message` | yes | - | The error message thrown by the processor. Supports <<accessing-template-fields,template snippets>>.
1422+
include::ingest-node-common-processor.asciidoc[]
14091423
|======
14101424

14111425
[source,js]
@@ -1452,6 +1466,7 @@ then it aborts the execution and leaves the array unmodified.
14521466
| `field` | yes | - | The array field
14531467
| `processor` | yes | - | The processor to execute against each field
14541468
| `ignore_missing` | no | false | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
1469+
include::ingest-node-common-processor.asciidoc[]
14551470
|======
14561471

14571472
Assume the following document:
@@ -1645,6 +1660,7 @@ Grok expression.
16451660
| `pattern_definitions` | no | - | A map of pattern-name and pattern tuples defining custom patterns to be used by the current processor. Patterns matching existing names will override the pre-existing definition.
16461661
| `trace_match` | no | false | when true, `_ingest._grok_match_index` will be inserted into your matched document's metadata with the index into the pattern found in `patterns` that matched.
16471662
| `ignore_missing` | no | false | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
1663+
include::ingest-node-common-processor.asciidoc[]
16481664
|======
16491665

16501666
Here is an example of using the provided patterns to extract out and name structured fields from a string field in
@@ -1919,6 +1935,7 @@ If the field is not a string, the processor will throw an exception.
19191935
| `replacement` | yes | - | The string to replace the matching patterns with
19201936
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
19211937
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
1938+
include::ingest-node-common-processor.asciidoc[]
19221939
|======
19231940

19241941
[source,js]
@@ -1946,6 +1963,7 @@ Throws an error when the field is not an array.
19461963
| `field` | yes | - | The field to be separated
19471964
| `separator` | yes | - | The separator character
19481965
| `target_field` | no | `field` | The field to assign the joined value to, by default `field` is updated in-place
1966+
include::ingest-node-common-processor.asciidoc[]
19491967
|======
19501968

19511969
[source,js]
@@ -1971,6 +1989,7 @@ Converts a JSON string into a structured JSON object.
19711989
| `field` | yes | - | The field to be parsed
19721990
| `target_field` | no | `field` | The field to insert the converted structured object into
19731991
| `add_to_root` | no | false | Flag that forces the serialized json to be injected into the top level of the document. `target_field` must not be set when this option is chosen.
1992+
include::ingest-node-common-processor.asciidoc[]
19741993
|======
19751994

19761995
All JSON-supported types will be parsed (null, boolean, number, array, object, string).
@@ -2082,6 +2101,7 @@ For example, if you have a log message which contains `ip=1.2.3.4 error=REFUSED`
20822101
| `trim_key` | no | `null` | String of characters to trim from extracted keys
20832102
| `trim_value` | no | `null` | String of characters to trim from extracted values
20842103
| `strip_brackets` | no | `false` | If `true` strip brackets `()`, `<>`, `[]` as well as quotes `'` and `"` from extracted values
2104+
include::ingest-node-common-processor.asciidoc[]
20852105
|======
20862106

20872107

@@ -2097,6 +2117,7 @@ Converts a string to its lowercase equivalent.
20972117
| `field` | yes | - | The field to make lowercase
20982118
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
20992119
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
2120+
include::ingest-node-common-processor.asciidoc[]
21002121
|======
21012122

21022123
[source,js]
@@ -2119,6 +2140,7 @@ Executes another pipeline.
21192140
|======
21202141
| Name | Required | Default | Description
21212142
| `name` | yes | - | The name of the pipeline to execute
2143+
include::ingest-node-common-processor.asciidoc[]
21222144
|======
21232145

21242146
[source,js]
@@ -2234,6 +2256,7 @@ Removes existing fields. If one field doesn't exist, an exception will be thrown
22342256
| Name | Required | Default | Description
22352257
| `field` | yes | - | Fields to be removed. Supports <<accessing-template-fields,template snippets>>.
22362258
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
2259+
include::ingest-node-common-processor.asciidoc[]
22372260
|======
22382261

22392262
Here is an example to remove a single field:
@@ -2272,6 +2295,7 @@ Renames an existing field. If the field doesn't exist or the new name is already
22722295
| `field` | yes | - | The field to be renamed. Supports <<accessing-template-fields,template snippets>>.
22732296
| `target_field` | yes | - | The new name of the field. Supports <<accessing-template-fields,template snippets>>.
22742297
| `ignore_missing` | no | `false` | If `true` and `field` does not exist, the processor quietly exits without modifying the document
2298+
include::ingest-node-common-processor.asciidoc[]
22752299
|======
22762300

22772301
[source,js]
@@ -2305,6 +2329,7 @@ caching see <<modules-scripting-using-caching, Script Caching>>.
23052329
| `id` | no | - | The stored script id to refer to
23062330
| `source` | no | - | An inline script to be executed
23072331
| `params` | no | - | Script Parameters
2332+
include::ingest-node-common-processor.asciidoc[]
23082333
|======
23092334

23102335
One of `id` or `source` options must be provided in order to properly reference a script to execute.
@@ -2401,6 +2426,7 @@ its value will be replaced with the provided one.
24012426
| `field` | yes | - | The field to insert, upsert, or update. Supports <<accessing-template-fields,template snippets>>.
24022427
| `value` | yes | - | The value to be set for the field. Supports <<accessing-template-fields,template snippets>>.
24032428
| `override` | no | true | If processor will update fields with pre-existing non-null-valued field. When set to `false`, such fields will not be touched.
2429+
include::ingest-node-common-processor.asciidoc[]
24042430
|======
24052431

24062432
[source,js]
@@ -2427,6 +2453,7 @@ Splits a field into an array using a separator character. Only works on string f
24272453
| `separator` | yes | - | A regex which matches the separator, eg `,` or `\s+`
24282454
| `target_field` | no | `field` | The field to assign the split value to, by default `field` is updated in-place
24292455
| `ignore_missing` | no | `false` | If `true` and `field` does not exist, the processor quietly exits without modifying the document
2456+
include::ingest-node-common-processor.asciidoc[]
24302457
|======
24312458

24322459
[source,js]
@@ -2455,6 +2482,7 @@ Throws an error when the field is not an array.
24552482
| `field` | yes | - | The field to be sorted
24562483
| `order` | no | `"asc"` | The sort order to use. Accepts `"asc"` or `"desc"`.
24572484
| `target_field` | no | `field` | The field to assign the sorted value to, by default `field` is updated in-place
2485+
include::ingest-node-common-processor.asciidoc[]
24582486
|======
24592487

24602488
[source,js]
@@ -2482,6 +2510,7 @@ NOTE: This only works on leading and trailing whitespace.
24822510
| `field` | yes | - | The string-valued field to trim whitespace from
24832511
| `target_field` | no | `field` | The field to assign the trimmed value to, by default `field` is updated in-place
24842512
| `ignore_missing` | no | `false` | If `true` and `field` does not exist, the processor quietly exits without modifying the document
2513+
include::ingest-node-common-processor.asciidoc[]
24852514
|======
24862515

24872516
[source,js]
@@ -2506,6 +2535,7 @@ Converts a string to its uppercase equivalent.
25062535
| `field` | yes | - | The field to make uppercase
25072536
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
25082537
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
2538+
include::ingest-node-common-processor.asciidoc[]
25092539
|======
25102540

25112541
[source,js]
@@ -2530,6 +2560,7 @@ URL-decodes a string
25302560
| `field` | yes | - | The field to decode
25312561
| `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
25322562
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
2563+
include::ingest-node-common-processor.asciidoc[]
25332564
|======
25342565

25352566
[source,js]

0 commit comments

Comments
 (0)