Description:
This processor updates the content of a FlowFile by evaluating a regular expression (regex) against the content and replacing the section of content that matches the regular expression with an alternate, user-defined, value.
Properties:
In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. If a property has a default value, it is indicated. If a property supports the use of the NiFi Expression Language (or simply, "expression language"), that is also indicated.
- Regular Expression
- The regular expression to use to evaluate the FlowFile content. While the Expression Language may be used here, the values returned by the Expression Language will be escaped. I.e., they will not be interpreted as Regular Expressions but will be interpreted as literal values.
For example, if you have an attribute named
X
with the value H.*o
and want it to match against "Hello", you cannot do this by referencing ${X}
. Rather, a reference to ${X}
will reference the exact literal H.*o
- Default value: (.*)
- Supports expression language: true
- Replacement Value
- The value to replace matching content with. Back-references to Regular Expression capturing groups are supported, but back-references that reference capturing groups that do not exist in the regular expression are treated as literal values.
- Default value: $1
- Supports expression language: true
- Character Set
- The character set in which the file is encoded.
- Default value: UTF-8
- Supports expression language: false
- Evaluation Mode
- Evaluate the 'Regular Expression' against each line (Line-by-Line) or buffer the entire file into memory (Entire Text) and then evaluate the 'Regular Expression'.
- Default value: Entire text
- Supports expression language: false
- Maximum Buffer Size
- Specifies the maximum amount of data to buffer (per file or per line, depending on the Evaluation Mode) in order to apply the regular expressions. If 'Entire Text' Mode is selected and the FlowFile is larger than this value, the FlowFile will be routed to 'failure'.
In 'Line-by-Line' Mode, if a single line is larger than this value, the FlowFile will be routed to 'failure'. A default value of 1 MB is provided, primarily for 'Entire Text' mode. In 'Line-by-Line' Mode, a value such as 8 KB or 16 KB is suggested.
This value is ignored and the buffer is not used if 'Regular Expression' is set to '.*'
- Default value: 1MB
- Supports expression language: false
Relationships:
- failure
- If FlowFiles cannot be updated, then they follow this relationship.
- success
- If FlowFiles are successfully updated, then they follow this relationship.