gsub.asciidoc 1.1 KB

1234567891011121314151617181920212223242526272829
  1. [[gsub-processor]]
  2. === Gsub Processor
  3. Converts a string field by applying a regular expression and a replacement.
  4. If the field is not a string, the processor will throw an exception.
  5. [[gsub-options]]
  6. .Gsub Options
  7. [options="header"]
  8. |======
  9. | Name | Required | Default | Description
  10. | `field` | yes | - | The field to apply the replacement to
  11. | `pattern` | yes | - | The pattern to be replaced
  12. | `replacement` | yes | - | The string to replace the matching patterns with
  13. | `target_field` | no | `field` | The field to assign the converted value to, by default `field` is updated in-place
  14. | `ignore_missing` | no | `false` | If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document
  15. include::common-options.asciidoc[]
  16. |======
  17. [source,js]
  18. --------------------------------------------------
  19. {
  20. "gsub": {
  21. "field": "field1",
  22. "pattern": "\.",
  23. "replacement": "-"
  24. }
  25. }
  26. --------------------------------------------------
  27. // NOTCONSOLE