EvaluateJsonPath 2025.10.2.19

Pacote

org.apache.nifi | nifi-standard-nar

Descrição

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, avaliar

Requisito de entrada

REQUIRED

Oferece suporte a propriedades dinâmicas confidenciais

falso

Propriedades

Propriedade

Descrição

Destination

Indica se os resultados da avaliação de JsonPath são gravados no conteúdo do FlowFile ou em um atributo do FlowFile; se estiver usando atributo, você deve especificar a propriedade de nome de atributo. Se definido como flowfile-content, somente um JsonPath poderá ser especificado e o nome da propriedade será ignorado.

Comprimento máximo da cadeia de caracteres

O comprimento máximo permitido de um valor de cadeia de caracteres ao analisar o documento JSON

Representação de valor nulo

Indica a representação desejada de expressões de caminho JSON que resultam em um valor nulo.

Comportamento de caminho não encontrado

Indica como lidar com expressões de caminho JSON ausentes quando o destino é definido como “flowfile-attribute”. A seleção de “warn” gerará um aviso quando uma expressão de caminho JSON não for encontrada. A seleção de “skip” omitirá os atributos de quaisquer expressões de caminho JSON não correspondentes.

Tipo de retorno

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”.

Relações

Nome

Descrição

failure

FlowFiles são encaminhados para essa relação quando o JsonPath não pode ser avaliado em relação ao conteúdo do FlowFile; por exemplo, se o FlowFile não for JSON válido

matched

FlowFiles são encaminhados para essa relação quando o JsonPath é avaliado com sucesso e o FlowFile é modificado como resultado

unmatched

FlowFiles são encaminhados para essa relação quando o JsonPath não corresponde ao conteúdo do FlowFile e o destino é definido como “flowfile-content”