Skip to main content

CalculateRecordStats

Description

Counts the number of Records in a record set, optionally counting the number of elements per category, where the categories are defined by user-defined properties.

Tags

metrics, record, stats

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-stats-readerController Service:
RecordReaderFactory

Implementations:
AvroReader
CEFReader
CSVReader
ExcelReader
GrokReader
JsonPathReader
JsonTreeReader
ReaderLookup
ScriptedReader
Syslog5424Reader
SyslogReader
WindowsEventLogReader
XMLReader
YamlTreeReader
A record reader to use for reading the records.
record-stats-limit *record-stats-limit10Limit the number of individual stats that are returned for each record path to the top N results.

Supports Expression Language, using FlowFile attributes and Environment variables.

Dynamic Properties

NameValueDescription
The name of the category. For example, sportThe RecordPath that points to the value of the category. For example /sportSpecifies a category that should be counted. For example, if the property name is 'sport' and the value is '/sport', the processor will count how many records have a value of 'soccer' for the /sport field, how many have a value of 'baseball' for the /sport, and so on. These counts be added as attributes named recordStats.sport.soccer, recordStats.sport.baseball.

Supports Expression Language: Yes, evaluated using FlowFile Attributes and Environment variables.

Relationships

NameDescription
failureIf a FlowFile cannot be processed for any reason, it is routed to this Relationship.
successAll FlowFiles that are successfully processed, are routed to this Relationship.

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
record.countA count of the records in the record set in the FlowFile.
recordStats.<User Defined Property Name>.<value>.countEach value discovered for the user defined property will have its own count attribute. Total number of top N value counts to be added is defined by the limit configuration.
recordStats.<User Defined Property Name>.countA count of the records that contain a value for the user defined property.

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

This component does not specify system resource considerations.

See Also