Thanks Bryan, Juan, Joe for the suggestion.

On Wed, Feb 3, 2016 at 7:55 PM, Bryan Bende <[email protected]> wrote:

> Just adding to what Juan said...
>
> The PutMongo processor sends the content of a FlowFile to Mongo, so if you
> use AttributesToJson -> PutMongo, with AttributesToJson Destination set to
> flowfile-content, then you would be sending the attributes to Mongo.
>
> -Bryan
>
> On Wed, Feb 3, 2016 at 9:22 AM, Juan Sequeiros <[email protected]>
> wrote:
>
>> Sudeep,
>>
>> You can pass the attributes by expressing them like this: ${key}
>> Or AttributeToJson:
>>
>> "
>> *Destination* flowfile-attribute
>>
>>    - flowfile-attribute
>>    - flowfile-content
>>
>> Control if JSON value is written as a new flowfile attribute
>> 'JSONAttributes' or written in the flowfile content. Writing to flowfile
>> content will overwrite any existing flowfile content.
>>
>> On Tue, Feb 2, 2016 at 10:51 PM, sudeep mishra <[email protected]>
>> wrote:
>>
>>> Hi Joe,
>>>
>>> Looks like I did not phrase my question correctly. AttributeToJson
>>> works fine and the documentation is also detailed.
>>>
>>> What I am looking for is a way to get the attributes of a flow file and
>>> pass only those to other processor.
>>>
>>> On Tue, Feb 2, 2016 at 10:50 PM, Joe Percivall <[email protected]>
>>> wrote:
>>>
>>>> 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: [email protected]
>>>>
>>>>
>>>>
>>>> On Tuesday, February 2, 2016 12:11 PM, sudeep mishra <
>>>> [email protected]> 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 <[email protected]>
>>>> 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: [email protected]
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >On Tuesday, February 2, 2016 1:17 AM, sudeep mishra <
>>>> [email protected]> 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
>>>>
>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>>
>>> Sudeep
>>>
>>>
>>
>>
>> --
>> Juan Carlos Sequeiros
>>
>
>


-- 
Thanks & Regards,

Sudeep

Reply via email to