ReplaceTextWithMapping

Description:

Updates the content of a FlowFile by evaluating a Regular Expression against it and replacing the section of the content that matches the Regular Expression with some alternate value provided in a mapping file.

Tags:

Text, Regular Expression, Update, Change, Replace, Modify, Regex, Mapping

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Regular ExpressionRegular Expression\S+The Regular Expression to search for in the FlowFile content
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Matching GroupMatching Group0The number of the matching group of the provided regex to replace with the corresponding value from the mapping file (if it exists).
Supports Expression Language: true (will be evaluated using variable registry only)
Mapping FileMapping FileThe name of the file (including the full path) containing the Mappings.

This property requires exactly one file to be provided..
Mapping File Refresh IntervalMapping File Refresh Interval60sThe polling interval in seconds to check for updates to the mapping file. The default is 60s.
Character SetCharacter SetUTF-8The Character Set in which the file is encoded
Maximum Buffer SizeMaximum Buffer Size1 MBSpecifies the maximum amount of data to buffer (per file) in order to apply the regular expressions. If a FlowFile is larger than this value, the FlowFile will be routed to 'failure'

Relationships:

NameDescription
successFlowFiles that have been successfully updated are routed to this relationship, as well as FlowFiles whose content does not match the given Regular Expression
failureFlowFiles that could not be updated are routed to this relationship

Reads Attributes:

None specified.

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.