Skip to main content

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.

Tags

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

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 NameAPI NameDefault ValueAllowable ValuesDescription
Record Reader *Record ReaderController Service:
RecordReaderFactory

Implementations:
AvroReader
CEFReader
CSVReader
ExcelReader
GrokReader
JsonPathReader
JsonTreeReader
ReaderLookup
ScriptedReader
Syslog5424Reader
SyslogReader
WindowsEventLogReader
XMLReader
YamlTreeReader
The Record Reader to use parsing the incoming FlowFile into Records
Record Writer *Record WriterController Service:
RecordSetWriterFactory

Implementations:
AvroRecordSetWriter
CSVRecordSetWriter
FreeFormTextRecordSetWriter
JsonRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
The Record Writer to use for serializing Records after they have been transformed
Script Language *Script EngineGroovy
  • Clojure
  • Groovy
The Language to use for the script
Script BodyScript BodyBody of script to execute. Only one of Script File or Script Body may be used
Script FileScript FilePath to script file to execute. Only one of Script File or Script Body may be used

Supports Expression Language, using Environment variables.
Module DirectoryModule DirectoryComma-separated list of paths to files and/or directories which contain modules required by the script.

Supports Expression Language, using Environment variables.

Dynamic Properties

This component does not support dynamic properties.

Relationships

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

Reads Attributes

This processor does not read attributes.

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

This component does not specify system resource considerations.

See Also

JoltTransformRecord, ExecuteScript, LookupRecord, QueryRecord, UpdateRecord