WARNING: Version 6.0 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Gsub Processor
editGsub Processor
editConverts a string field by applying a regular expression and a replacement. If the field is not a string, the processor will throw an exception.
Table 21. Gsub Options
Name | Required | Default | Description |
---|---|---|---|
|
yes |
- |
The field to apply the replacement to |
|
yes |
- |
The pattern to be replaced |
|
yes |
- |
The string to replace the matching patterns with |
|
no |
|
The field to assign the converted value to, by default |
|
no |
|
If |
{ "gsub": { "field": "field1", "pattern": "\.", "replacement": "-" } }