I think AttributeRollingWindow was made to aggregate a numeric
attribute. So for example, if all flows files had an attribute called
"amount" that was an integer, then you could say Value to Track =
${amount} and it would aggregate those values over window.

In your case the attribute you have is not the value to aggregate, its
a key. The value in your case is a constant of 1 where you want to
increment the aggregated value by 1 whenever you see the key.

I guess it depends what you want to do with the aggregated value, but
your situation seems closer to a counter which could be tracked with
UpdateCounter setting the Counter Name to ${eventUuid} and the Delta
to 1, but then I don't know exactly how you would use this counter
later.

On Fri, Aug 23, 2019 at 1:59 PM Steve Robert
<[email protected]> wrote:
>
> Hi Guys ,
>
> I apologize in advance if my question seems trivial but I am new on Nifi.
> I'm studying Nifi for an integration with Flink that I'm used to.
>
> Since flink I send events using Site-to-Site to Nifi.
> the Flowfile have attribute "eventUuid":"97f82c90-0782-4aab-8850-56ee60b0b73d"
>
> I would like to do an aggregation on events based on the value of this 
> attribute,
>
> so I look at the documentation of AttributeRollingWindow.
>
> I understood by looking at the errors that this operator does not accept 
> strings and therefore can not track a value on String
> Value to Track : ${eventUuid}   will throw NumberFormatExceptions.
>
> Value to Track : ${eventUuid:toNumber()}  will not work  because UUID 128 bit 
> can't be convert to an 32 bytes number;
>
> Is this a limitation or a bad approach on my part? I can not use an event on 
> the timestamp here because this UUID is generated at the beginning of the 
> workflow
> Thank a lot for your  help
> Steve
>
>

Reply via email to