FilterAttribute
Description
Filters the attributes of a FlowFile by retaining specified attributes and removing the rest or by removing specified attributes and retaining the rest.
Tags
Attribute Expression Language, attributes, delete, filter, modification, regex, regular expression, remove, retain
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Filter Mode * | Filter Mode | Retain |
| Specifies the strategy to apply on filtered attributes. Either 'Remove' or 'Retain' only the matching attributes. |
Attribute Matching Strategy * | Attribute Matching Strategy | Enumerate attributes |
| Specifies the strategy to filter attributes by. |
Filtered Attributes * | Filtered Attributes | A set of attribute names to filter from FlowFiles. Each attribute name is separated by the comma delimiter ','. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
| ||
Filtered Attributes Pattern * | Filtered Attributes Pattern | A regular expression to match names of attributes to filter from FlowFiles. Supports Expression Language, using FlowFile attributes and Environment variables. This property is only considered if:
|
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
success | All successful FlowFiles are routed to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
This processor does not write attributes.
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
This component requires an incoming relationship.
Example Use Cases
Use Case 1
Retain all FlowFile attributes matching a regular expression
Configuration
Set "Filter Mode" to "Retain".
Set "Attribute Matching Strategy" to "Use regular expression".
Specify the "Filtered Attributes Pattern", e.g. "my-property|a-prefix[.].*".
Use Case 2
Remove only a specified set of FlowFile attributes
Configuration
Set "Filter Mode" to "Remove".
Set "Attribute Matching Strategy" to "Enumerate attributes".
Specify the set of "Filtered Attributes" using the delimiter comma ',', e.g. "my-property,other,filename".
System Resource Considerations
This component does not specify system resource considerations.