nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Percivall <joeperciv...@yahoo.com>
Subject Re: Add date in the flow file attribute
Date Tue, 02 Feb 2016 17:20:20 GMT
Glad UpdateAttribute works for you.

You are seeing AttributeToJson append the information to the content? That is not what the
documentation says or how it should be behaving (should replace the contents). Could you send
more information documenting this?
 
Joe
- - - - - - 
Joseph Percivall
linkedin.com/in/Percivall
e: joepercivall@yahoo.com



On Tuesday, February 2, 2016 12:11 PM, sudeep mishra <sudeepshekharm@gmail.com> wrote:



Thanks Joe.

The UpdateAttribute processor can be helpful for my case. Also is it possible to push only
the attributes to  Mongo? I could see an AttributeToJson object but it seems to be appending
the information in flow file content or attribute. What is a good way to capture only attributes
and send it to MongoDb?



On Tue, Feb 2, 2016 at 8:42 PM, Joe Percivall <joepercivall@yahoo.com> wrote:

Hello Sudeep,
>
>How precise do you need the date/time to be? What you could do is add an UpdateAttribute
processor[1] after ingesting which uses the Expression language functions "now" [2] and "format"
[3] to add the date/time down to the millisecond.
>
>There would of course be a bit of error between when it was ingested and when it is processed
by UpdateAttribute but UpdateAttribute is very fast and there may actually not be any measurable
delay.
>
>[1] https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.attributes.UpdateAttribute/index.html
>[2] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#now
>[3] https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#format
>
>Hope that helps,
>Joe
>- - - - - -
>Joseph Percivall
>linkedin.com/in/Percivall
>e: joepercivall@yahoo.com
>
>
>
>
>On Tuesday, February 2, 2016 1:17 AM, sudeep mishra <sudeepshekharm@gmail.com> wrote:
>
>
>
>Hi,
>
>I need to create some audits around the NiFi flows and want to add the time a flow file
was received by a particular processor. Is there a way to add this date in the attributes
for flow files?
>
>I can see a date in the 'Details' section for a data provenance entry but can we get such
a date in the attributes as well?
>
>
>Thanks & Regards,
>
>Sudeep
>


-- 

Thanks & Regards,

Sudeep 

Mime
View raw message