EvaluateJsonPath 2025.10.2.19

Bundle

org.apache.nifi | nifi-standard-nar

Beschreibung

Evaluates one or more JsonPath expressions against the content of a FlowFile. The results of those expressions are assigned to FlowFile Attributes or are written to the content of the FlowFile itself, depending on configuration of the Processor. JsonPaths are entered by adding user-defined properties; the name of the property maps to the Attribute Name into which the result will be placed (if the Destination is flowfile-attribute; otherwise, the property name is ignored). The value of the property must be a valid JsonPath expression. A Return Type of ‚auto-detect‘ will make a determination based off the configured destination. When ‚Destination‘ is set to ‚flowfile-attribute,‘ a return type of ‚scalar‘ will be used. When ‚Destination‘ is set to ‚flowfile-content,‘ a return type of ‚JSON‘ will be used. If the JsonPath evaluates to a JSON array or JSON object and the Return Type is set to ‚scalar‘ the FlowFile will be unmodified and will be routed to failure. A Return Type of JSON can return scalar values if the provided JsonPath evaluates to the specified value and will be routed as a match. If Destination is ‚flowfile-content‘ and the JsonPath does not evaluate to a defined path, the FlowFile will be routed to ‚unmatched‘ without having its contents modified. If Destination is ‚flowfile-attribute‘ and the expression matches nothing, attributes will be created with empty strings as the value unless ‚Path Not Found Behaviour‘ is set to ‚skip‘, and the FlowFile will always be routed to ‚matched.‘

Tags

JSON, JsonPath, bewerten

Eingabeanforderung

REQUIRED

Unterstützt sensible dynamische Eigenschaften

false

Eigenschaften

Eigenschaft

Beschreibung

Destination

Gibt an, ob die Ergebnisse der JsonPath-Bewertung in den FlowFile-Inhalt oder in ein FlowFile-Attribut geschrieben werden. Wenn Sie ein Attribut verwenden, müssen Sie die Eigenschaft „Attribute Name“ angeben. Bei der Einstellung „flowfile-content“ kann nur ein JsonPath angegeben werden, und der Eigenschaftsname wird ignoriert.

Max String Length

Die maximal zulässige Länge eines Zeichenfolgenwertes beim Parsen des JSON-Dokuments

Null Value Representation

Gibt die gewünschte Darstellung von JSON-Pfadausdrücken an, die einen Nullwert ergeben.

Path Not Found Behavior

Gibt an, wie fehlende JSON-Pfadausdrücke behandelt werden sollen, wenn das Ziel auf „flowfile-attribute“ gesetzt ist. Wenn Sie „warn“ wählen, wird eine Warnung ausgegeben, wenn ein JSON-Pfadausdruck nicht gefunden wird. Wenn Sie „skip“ wählen, werden Attribute für alle nicht übereinstimmenden JSON-Pfadausdrücke ausgelassen.

Return Type

Indicates the desired return type of the JSON Path expressions. Selecting ‚auto-detect‘ will set the return type to ‚json‘ for a Destination of ‚flowfile-content‘, and ‚scalar‘ for a Destination of ‚flowfile-attribute‘.

Beziehungen

Name

Beschreibung

failure

FlowFiles werden an diese Beziehung weitergeleitet, wenn der JsonPath nicht anhand des Inhalts des FlowFile ausgewertet werden kann, zum Beispiel, wenn das FlowFile kein gültiges JSON ist.

matched

FlowFiles werden an diese Beziehung weitergeleitet, wenn der JsonPath erfolgreich ausgewertet und das FlowFile daraufhin geändert wurde.

unmatched

FlowFiles werden an diese Beziehung weitergeleitet, wenn der JsonPath nicht mit dem Inhalt des FlowFile übereinstimmt und das Ziel auf „flowfile-content“ gesetzt ist.