2017-10-25 20 views
0

NiFi 1.3.0では、JSONファイルを分割してカウンタを名前filenamecounterに更新するためのフローを作成して、各分割を異なるファイル名に保存できるようにしました。私は、NiFiカウンタペインを見るとカウンタ値が更新されることがわかります。しかし、私はこの値にどのようにアクセスできますか?NiFiでカウンタの値を使用する方法

カウンタ名とカウンタプロパティで属性を設定しようとしました。 ${filenamecounter}${filenamecounter.counter}と同じですが、失敗しました。

enter image description here

答えて

1

現在のカウンターはあなたが本当に表現言語からそれらにアクセスすることはできません、ほとんどの監視機能です。それらは "ソースxyzから受け取ったメッセージの数"のような質問に答えるために使われます。あなたのケースでは

、「スプリット」すべてのプロセッサは、フラグメント属性の標準セットを書くべきである:

@WritesAttribute(attribute = "fragment.identifier", 
    description = "All split FlowFiles produced from the same parent FlowFile will have the same randomly generated UUID added for this attribute"), 
@WritesAttribute(attribute = "fragment.index", 
    description = "A one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile"), 
@WritesAttribute(attribute = "fragment.count", 
    description = "The number of split FlowFiles generated from the parent FlowFile"), 

だから、あなたは、ファイル名に$ {fragment.index}を使用することができるはずです。

関連する問題