Replace
Filter plugin : Replace
- Author: InterestingLab
- Homepage: https://interestinglab.github.io/seatunnel-docs
- Version: 1.0.0
Description
Replaces field contents based on regular expression.
Options
name | type | required | default value |
---|---|---|---|
pattern | string | yes | - |
replacement | string | yes | - |
source_field | string | no | raw_message |
target_field | string | no | replaced |
pattern [string]
regular expression, such as [a-z0-9], \w, \d
Regular expression used for matching string, such as "[a-zA-Z0-9_-]+"
.Please see Regex Pattern for details.
You can also go to Regex 101 to test your regex interactively.
replacement [string]
String replacement.
source_field [string]
Source field, default is raw_message
.
target_field [string]
New field name, default is replaced
.
Examples
replace {
target_field = "tmp"
source_field = "message"
pattern = "\w+"
replacement = "are"
}
Replace \w+ in
message
with are and set it totmp
column.