elasticsearch/docs/reference/ingest/processors/rename.asciidoc
ShourieG 147484b059
[elasticsearch][processors] - Added support for override flag in rename processor (#103565)
* added override flag for rename processer along with factory tests

* added yaml tests for rename processor using the override flag

* updated renameProcessor tests to include override flag as a parameter

* updated rename processor tests to incorporate override flag = true scenario

* updated rename processor asciidoc with override option

* updated rename processor asciidoc with override option

* removed unnecessary supresswarnings tag

* corrected formatting errors

* updated processor tests

* fixed yaml tests

* Prefer early throw style here

* Whitespace

* Move and rewrite this test

It's just a simple test of the primary behavior of the rename
processor, so put it first and simplify it.

* Rename this test

It doesn't actually exercise template snippets

* Tidy up this test

---------

Co-authored-by: Joe Gallo <joegallo@gmail.com>
2024-01-11 16:00:02 +05:30

30 lines
1.1 KiB
Text

[[rename-processor]]
=== Rename processor
++++
<titleabbrev>Rename</titleabbrev>
++++
Renames an existing field. If the field doesn't exist or the new name is already used, an exception will be thrown.
[[rename-options]]
.Rename Options
[options="header"]
|======
| Name | Required | Default | Description
| `field` | yes | - | The field to be renamed. Supports <<template-snippets,template snippets>>.
| `target_field` | yes | - | The new name of the field. Supports <<template-snippets,template snippets>>.
| `ignore_missing` | no | `false` | If `true` and `field` does not exist, the processor quietly exits without modifying the document.
| `override` | no | `false` | If `true`, the processor will update pre-existing non-null-valued fields. When set to `false`, such fields will not be touched.
include::common-options.asciidoc[]
|======
[source,js]
--------------------------------------------------
{
"rename": {
"field": "provider",
"target_field": "cloud.provider"
}
}
--------------------------------------------------
// NOTCONSOLE