mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
54 lines
1.4 KiB
Text
54 lines
1.4 KiB
Text
[[remove-processor]]
|
|
=== Remove processor
|
|
++++
|
|
<titleabbrev>Remove</titleabbrev>
|
|
++++
|
|
|
|
Removes existing fields. If one field doesn't exist, an exception will be thrown.
|
|
|
|
[[remove-options]]
|
|
.Remove Options
|
|
[options="header"]
|
|
|======
|
|
| Name | Required | Default | Description
|
|
| `field` | yes | - | Fields to be removed. Supports <<template-snippets,template snippets>>.
|
|
| `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
|
|
| `keep` | no | - | Fields to be kept. When set, all fields other than those specified are removed.
|
|
include::common-options.asciidoc[]
|
|
|======
|
|
|
|
Here is an example to remove a single field:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"remove": {
|
|
"field": "user_agent"
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// NOTCONSOLE
|
|
|
|
To remove multiple fields, you can use the following query:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"remove": {
|
|
"field": ["user_agent", "url"]
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// NOTCONSOLE
|
|
|
|
You can also choose to remove all fields other than a specified list:
|
|
|
|
[source,js]
|
|
--------------------------------------------------
|
|
{
|
|
"remove": {
|
|
"keep": ["url"]
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// NOTCONSOLE
|