Provides the ability to evaluate a simple script against each record in an incoming FlowFile. The script may transform the record in some way, filter the record, or fork additional records. See Processor's Additional Details for more information.
record, transform, script, groovy, jython, python, update, modify, filter
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 |
|---|---|---|---|---|
| Record Reader | Record Reader | Controller Service API: RecordReaderFactory Implementations: CEFReader SyslogReader ReaderLookup ProtobufReader Syslog5424Reader CSVReader GrokReader WindowsEventLogReader ScriptedReader AvroReader ParquetReader JsonPathReader ExcelReader JsonTreeReader YamlTreeReader XMLReader | The Record Reader to use parsing the incoming FlowFile into Records | |
| Record Writer | Record Writer | Controller Service API: RecordSetWriterFactory Implementations: JsonRecordSetWriter RecordSetWriterLookup AvroRecordSetWriter XMLRecordSetWriter FreeFormTextRecordSetWriter CSVRecordSetWriter ParquetRecordSetWriter ScriptedRecordSetWriter | The Record Writer to use for serializing Records after they have been transformed | |
| Script Language | Script Engine | Groovy |
| The Language to use for the script |
| Script Body | Script Body | Body of script to execute. Only one of Script File or Script Body may be used | ||
| Script File | Script File | Path to script file to execute. Only one of Script File or Script Body may be used This property requires exactly one file to be provided.. Supports Expression Language: true (will be evaluated using variable registry only) | ||
| Module Directory | Module Directory | Comma-separated list of paths to files and/or directories which contain modules required by the script. This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: file, directory. Supports Expression Language: true (will be evaluated using variable registry only) |
| Name | Description |
|---|---|
| success | Each FlowFile that were successfully transformed will be routed to this Relationship |
| failure | Any FlowFile that cannot be transformed will be routed to this Relationship |
| Name | Description |
|---|---|
| mime.type | Sets the mime.type attribute to the MIME Type specified by the Record Writer |
| record.count | The number of records in the FlowFile |
| record.error.message | This attribute provides on failure the error message encountered by the Reader or Writer. |
| Required Permission | Explanation |
|---|---|
| execute code | Provides operator the ability to execute arbitrary code assuming all permissions that NiFi has. |
ExecuteScript, UpdateRecord, QueryRecord, JoltTransformRecord, LookupRecord