UpdateAttribute 2.0.0

Bundle
org.apache.nifi | nifi-update-attribute-nar
Description
Updates the Attributes for a FlowFile by using the Attribute Expression Language and/or deletes the attributes based on a regular expression
Tags
Attribute Expression Language, attributes, delete, modification, state, update
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
Properties
Dynamic Properties
State Management
Scopes Description
LOCAL Gives the option to store values not only on the FlowFile but as stateful variables to be referenced in a recursive manner.
Relationships
Name Description
success All successful FlowFiles are routed to this relationship
Writes Attributes
Name Description
See additional details This processor may write or remove zero or more attributes as described in additional details
Use Cases
  • Add a new FlowFile attribute
    Description
    Add a new FlowFile attribute
    Configuration
    Leave "Delete Attributes Expression" and "Stateful Variables Initial Value" unset.
    Set "Store State" to "Do not store state".
    
    Add a new property. The name of the property will become the name of the newly added attribute.
    The value of the property will become the value of the newly added attribute. The value may use the NiFi Expression Language in order to reference other
    attributes or call Expression Language functions.
    
  • Overwrite a FlowFile attribute with a new value
    Description
    Overwrite a FlowFile attribute with a new value
    Configuration
    Leave "Delete Attributes Expression" and "Stateful Variables Initial Value" unset.
    Set "Store State" to "Do not store state".
    
    Add a new property. The name of the property will become the name of the attribute whose value will be overwritten.
    The value of the property will become the new value of the attribute. The value may use the NiFi Expression Language in order to reference other
    attributes or call Expression Language functions.
    
    For example, to change the `txId` attribute to the uppercase version of its current value, add a property named `txId` with a value of `${txId:toUpper()}`
    
  • Rename a file
    Description
    Rename a file
    Configuration
    Leave "Delete Attributes Expression" and "Stateful Variables Initial Value" unset.
    Set "Store State" to "Do not store state".
    
    Add a new property whose name is `filename` and whose value is the desired filename.
    
    For example, to set the filename to `abc.txt`, add a property named `filename` with a value of `abc.txt`.
    To add the `txId` attribute as a prefix to the filename, add a property named `filename` with a value of `${txId}${filename}`.
    Or, to make the filename more readable, separate the txId from the rest of the filename with a hyphen by using a value of `${txId}-${filename}`.