Generates a CSV representation of the input FlowFile Attributes. The resulting CSV can be written to either a newly generated attribute named 'CSVAttributes' or written to the FlowFile as content. If the attribute value contains a comma, newline or double quote, then the attribute value will be escaped with double quotes. Any double quote characters in the attribute value are escaped with another double quote.
csv, attributes, flowfile
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 Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Attribute List | attribute-list | Comma separated list of attributes to be included in the resulting CSV. If this value is left empty then all existing Attributes will be included. This list of attributes is case sensitive and supports attribute names that contain commas. If an attribute specified in the list is not found it will be emitted to the resulting CSV with an empty string or null depending on the 'Null Value' property. If a core attribute is specified in this list and the 'Include Core Attributes' property is false, the core attribute will be included. The attribute list ALWAYS wins. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) | ||
Attributes Regular Expression | attributes-regex | Regular expression that will be evaluated against the flow file attributes to select the matching attributes. This property can be used in combination with the attributes list property. The final output will contain a combination of matches found in the ATTRIBUTE_LIST and ATTRIBUTE_REGEX. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) | ||
Destination | destination | flowfile-attribute |
| Control if CSV value is written as a new flowfile attribute 'CSVData' or written in the flowfile content. |
Include Core Attributes | include-core-attributes | true |
| Determines if the FlowFile org.apache.nifi.flowfile.attributes.CoreAttributes, which are contained in every FlowFile, should be included in the final CSV value generated. Core attributes will be added to the end of the CSVData and CSVSchema strings. The Attribute List property overrides this setting. |
Null Value | null-value | false |
| If true a non existing or empty attribute will be 'null' in the resulting CSV. If false an empty string will be placed in the CSV |
Include Schema | include-schema | false |
| If true the schema (attribute names) will also be converted to a CSV string which will either be applied to a new attribute named 'CSVSchema' or applied at the first row in the content depending on the DESTINATION property setting. |
Name | Description |
---|---|
success | Successfully converted attributes to CSV |
failure | Failed to convert attributes to CSV |
Name | Description |
---|---|
CSVSchema | CSV representation of the Schema |
CSVData | CSV representation of Attributes |