FlattenJson
Description
Provides the user with the ability to take a nested JSON document and flatten it into a simple key/value pair document. The keys are combined at each level with a user-defined separator that defaults to '.'. This Processor also allows to unflatten back the flattened json. It supports four kinds of flatten mode such as normal, keep-arrays, dot notation for MongoDB query and keep-primitive-arrays. Default flatten mode is 'keep-arrays'.
Tags
flatten, json, unflatten
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 Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Separator | flatten-json-separator | . | The separator character used for joining keys. Must be a JSON-legal character. Supports Expression Language, using FlowFile attributes and Environment variables. | |
Flatten Mode * | flatten-mode | keep arrays |
| Specifies how json should be flattened/unflattened |
Ignore Reserved Characters * | ignore-reserved-characters | false |
| If true, reserved characters in keys will be ignored |
Return Type * | flatten-json-return-type | flatten |
| Specifies the desired return type of json such as flatten/unflatten |
Character Set * | flatten-json-character-set | UTF-8 | The Character Set in which file is encoded | |
Pretty Print JSON * | flatten-json-pretty-print-json | false |
| Specifies whether or not resulted json should be pretty printed |
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
failure | Files that cannot be flattened/unflattened go to this relationship. |
success | Successfully flattened/unflattened files go to this relationship. |
Reads Attributes
This processor does not read attributes.
Writes Attributes
This processor does not write attributes.
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.