UpdateRecord

Description:

Updates the contents of a FlowFile that contains Record-oriented data (i.e., data that can be read via a RecordReader and written by a RecordWriter). This Processor requires that at least one user-defined Property be added. The name of the Property should indicate a RecordPath that determines the field that should be updated. The value of the Property is either a replacement value (optionally making use of the Expression Language) or is itself a RecordPath that extracts a value from the Record. Whether the Property value is determined to be a RecordPath or a literal value depends on the configuration of the <Replacement Value Strategy> Property.

Additional Details...

Tags:

update, record, generic, schema, json, csv, avro, log, logs, freeform, text

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.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Record Readerrecord-readerController Service API:
RecordReaderFactory
Implementations: CEFReader
Syslog5424Reader
ScriptedReader
SyslogReader
CSVReader
GrokReader
JsonTreeReader
XMLReader
AvroReader
ReaderLookup
WindowsEventLogReader
ParquetReader
JsonPathReader
Specifies the Controller Service to use for reading incoming data
Record Writerrecord-writerController Service API:
RecordSetWriterFactory
Implementations: RecordSetWriterLookup
XMLRecordSetWriter
FreeFormTextRecordSetWriter
CSVRecordSetWriter
ScriptedRecordSetWriter
AvroRecordSetWriter
JsonRecordSetWriter
ParquetRecordSetWriter
Specifies the Controller Service to use for writing out the records
Replacement Value Strategyreplacement-value-strategyLiteral Value
  • Literal Value The value entered for a Property (after Expression Language has been evaluated) is the desired value to update the Record Fields with. Expression Language may reference variables 'field.name', 'field.type', and 'field.value' to access information about the field and the value of the field being evaluated.
  • Record Path Value The value entered for a Property (after Expression Language has been evaluated) is not the literal value to use but rather is a Record Path that should be evaluated against the Record, and the result of the RecordPath will be used to update the Record. Note that if this option is selected, and the Record Path results in multiple values for a given Record, the input FlowFile will be routed to the 'failure' Relationship.
Specifies how to interpret the configured replacement values

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
A RecordPath.The value to use to replace fields in the record that match the RecordPathAllows users to specify values to use to replace fields in the record that match the RecordPath.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
successFlowFiles that are successfully transformed will be routed to this relationship
failureIf a FlowFile cannot be transformed from the configured input format to the configured output format, the unchanged FlowFile will be routed to this relationship

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
record.indexThis attribute provides the current row index and is only available inside the literal value expression.
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:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.

See Also:

ConvertRecord