Vyshali, UpdateAttribute adds an attribute to the FlowFile i.e. just like filename, filesize, etc., when you set "status" : "OK" using UpdateAttribute, the field doesn't actually get added to the JSON content. I would rather suggest you to use 'UpdateRecord' processor and configure it with JSON Reader and JSON Writer (providing them with a schema for your JSON content) and set the new field "status": "OK". For more details on UpdateRecord, check this tutorial. https://community.hortonworks.com/articles/189642/update-the-contents-of-flowfile-by-using-updaterec.html
- Sivaprasanna On Mon, Oct 15, 2018 at 6:09 PM N, Vyshali <[email protected]> wrote: > Hi, > > > > I’m consuming the message published through “PutJMS” processor using > “ConsumeJMS” processor. The message is in JSON format. I added the value of > “*status*” as “*OK*” using “UpdateAttribute” processor. I wanted to route > it to “AttributesToJSON” processor if the value of *$.result.status is > “OK”* for which I’m using the “RouteOnAttribute” processor .The regular > expression which I used for routing is > *${status:contains(${result.status})}*. But the routing doesn’t happen > correctly. > > > > Sample input json : > > { > > "revision": "1.0.0", > > "acceptor": "100", > > "result": { > > "status": "OK" > > } > > } > > > > Please let me know where I’m missing. > > Thanks in advance > > > > Regards > > Vyshali >
