ScriptedTransformRecord

Description:

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.

Additional Details...

Tags:

record, transform, script, groovy, jython, python, update, modify, filter

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.

NameDefault ValueAllowable ValuesDescription
Record ReaderController Service API:
RecordReaderFactory
Implementations: ScriptedReader
XMLReader
GrokReader
AvroReader
WindowsEventLogReader
JsonPathReader
ReaderLookup
CSVReader
Syslog5424Reader
SyslogReader
JsonTreeReader
ParquetReader
The Record Reader to use parsing the incoming FlowFile into Records
Record WriterController Service API:
RecordSetWriterFactory
Implementations: FreeFormTextRecordSetWriter
AvroRecordSetWriter
ParquetRecordSetWriter
ScriptedRecordSetWriter
JsonRecordSetWriter
RecordSetWriterLookup
CSVRecordSetWriter
XMLRecordSetWriter
The Record Writer to use for serializing Records after they have been transformed
Script LanguageGroovy
  • Clojure
  • ECMAScript
  • Groovy
  • lua
  • python
  • ruby
The Language to use for the script
Script BodyBody of script to execute. Only one of Script File or Script Body may be used
Script FilePath 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 DirectoryComma-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: directory, file.

Supports Expression Language: true (will be evaluated using variable registry only)

Relationships:

NameDescription
successEach FlowFile that were successfully transformed will be routed to this Relationship
failureAny FlowFile that cannot be transformed will be routed to this Relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
mime.typeSets the mime.type attribute to the MIME Type specified by the Record Writer
record.countThe number of records in the FlowFile
record.error.messageThis attribute provides on failure the error message encountered by the Reader or Writer.

State management:

This component does not store state.

Restricted:

Required PermissionExplanation
execute codeProvides operator the ability to execute arbitrary code assuming all permissions that NiFi has.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.

See Also:

ExecuteScript, UpdateRecord, QueryRecord, JoltTransformRecord, LookupRecord