如何重命名 NiFi 属性
How do I rename a NiFi attribute
我有一个包含多个进程的 NiFi 流。
在流程的某个阶段,一个文件被读取并且一些属性被添加到流程文件中。现有流程是遗留流程,因此我无法更改遗留流程中属性的原始名称。并且该过程可能会在其他地方使用。
所以下游,我现在想使用在 NiFi GUI 上配置的过程将属性 'A' 重命名为 'B'。
如何重命名属性?
我可以使用 UpdateAttribute 并创建一个新的 属性 b 并将其值设置为 ${A}。但是如何删除 property/attribute A?
UpdateAttribute 包含可以删除属性的“删除属性表达式”属性。
您可以使用 1 个 UpdateAttribute 处理器创建一个名为 B 且值为 A 的新属性,然后将 A 添加到“删除属性表达式”。它将执行更新,然后执行删除 - 因此它有效地重命名了属性。
"The third way is the "Delete Attributes Expression"; this allows you
to provide a regular expression and any attributes with a matching
name will be deleted.
Please note that "Delete Attributes Expression" supersedes any updates
that occur. If an existing attribute matches the "Delete Attributes
Expression", it will be removed whether it was updated or not. That
said, the "Delete Attributes Expression" only applies to attributes
that exist in the input FlowFile, if it is added by this processor,
the "Delete Attributes Expression" will not detect it."
我有一个包含多个进程的 NiFi 流。 在流程的某个阶段,一个文件被读取并且一些属性被添加到流程文件中。现有流程是遗留流程,因此我无法更改遗留流程中属性的原始名称。并且该过程可能会在其他地方使用。
所以下游,我现在想使用在 NiFi GUI 上配置的过程将属性 'A' 重命名为 'B'。
如何重命名属性?
我可以使用 UpdateAttribute 并创建一个新的 属性 b 并将其值设置为 ${A}。但是如何删除 property/attribute A?
UpdateAttribute 包含可以删除属性的“删除属性表达式”属性。
您可以使用 1 个 UpdateAttribute 处理器创建一个名为 B 且值为 A 的新属性,然后将 A 添加到“删除属性表达式”。它将执行更新,然后执行删除 - 因此它有效地重命名了属性。
"The third way is the "Delete Attributes Expression"; this allows you to provide a regular expression and any attributes with a matching name will be deleted.
Please note that "Delete Attributes Expression" supersedes any updates that occur. If an existing attribute matches the "Delete Attributes Expression", it will be removed whether it was updated or not. That said, the "Delete Attributes Expression" only applies to attributes that exist in the input FlowFile, if it is added by this processor, the "Delete Attributes Expression" will not detect it."