nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l vic <lvic4...@gmail.com>
Subject Re: UpdateAttributes use problems
Date Mon, 19 Nov 2018 16:09:45 GMT
"AttributesToJson" seems to work

On Mon, Nov 19, 2018 at 10:14 AM Nathan Gough <thenatog@gmail.com> wrote:

> UpdateAttribute only updates flowfile attributes and will not change the
> content. Flowfile attributes and the actual content are two separate
> objects and are not linked. Updating one does not affect the other. If you
> want to manipulate your JSON content, look at the JoltTransformJSON
> processor:
> https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.8.0/org.apache.nifi.processors.standard.JoltTransformJSON/index.html
>
>
>
>
>
> *From: *l vic <lvic4594@gmail.com>
> *Reply-To: *<users@nifi.apache.org>
> *Date: *Saturday, November 17, 2018 at 8:29 AM
> *To: *<users@nifi.apache.org>
> *Subject: *Re: UpdateAttributes use problems
>
>
>
> Actually, if I check flowfile attributes after UpdateAttributes - it does
> work, eg 'value_filter' and 'name' are gone and 'ts' is added. But contents
> of the queue, or data provenance of the next processor doesn't seem to
> change, eg output claim still looks like {"value_filter":"*", "name":"me"}
>
> It's confusing: if I change attributes in flowfile, shouldn't it be
> reflected in the output json, or should i add another processor to make it
> happen? After all, it's really that json content i am seeking to change...
>
>
>
> On Fri, Nov 16, 2018 at 4:27 PM Nathan Gough <thenatog@gmail.com> wrote:
>
> I set up an UpdateAttribute processor with the same configuration as the
> screenshot you sent and it worked for me.
>
>
>
> What version of NiFi are you using?
>
>
>
> *From: *l vic <lvic4594@gmail.com>
> *Reply-To: *<users@nifi.apache.org>
> *Date: *Friday, November 16, 2018 at 1:53 PM
> *To: *<users@nifi.apache.org>
> *Subject: *UpdateAttributes use problems
>
>
>
> Hello,
>
> I am trying to use UpdateAttributes remove 'value_filter" and "name"
> attributes from flowfile and add timestamp attribute, so I specified
> "value_filter | name" in "DeleteAttributesExpression" and added attribute
> "ts" with value '${now():toNumber()}'... No changes in resulting flowfile
> and no failures. What am i doing wrong?
>
> Thanks,
>
>
>
>

Mime
View raw message