"AttributesToJson" seems to work On Mon, Nov 19, 2018 at 10:14 AM Nathan Gough <[email protected]> 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 <[email protected]> > *Reply-To: *<[email protected]> > *Date: *Saturday, November 17, 2018 at 8:29 AM > *To: *<[email protected]> > *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 <[email protected]> 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 <[email protected]> > *Reply-To: *<[email protected]> > *Date: *Friday, November 16, 2018 at 1:53 PM > *To: *<[email protected]> > *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, > > > >
