Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Remove double quotes in Nifi processor output

Remove double quotes in Nifi processor output

New Contributor

I have a nifi output in the following format:

{ "sentiment" : "NEUTRAL", "clientid" : "1", "taxonomies" : "[51,41]", "type" : "twitter", "socialtags" : "[\"research\",\"Pembrolizumab\",\"immunotherapy\",\"lungcancer\",\"clinicaltrial\"]", "url" : "https://twitter.com/ValleyHospital/status/905770926368804866", "timestamp" : "1504787591913" }

I need to remove the double quotes around the values for socialtags & taxonomies, the final output is expected as follows:

{ "sentiment": "NEUTRAL", "clientid": 1, "taxonomies": [51,41], "type": "twitter", "socialtags": ["research", "Pembrolizumab", "immunotherapy", "lungcancer", "clinicaltrial"], "url": "https: //twitter.com/ValleyHospital/status/905770926368804866", "timestamp": 1504787591913 }

The values of socialtags and taxonomies are integer and string arrays and hence can have any number of values including no values, in case of no values it will return just [ ] as the value, how can I remove these double quotes.

1 REPLY 1

Re: Remove double quotes in Nifi processor output

New Contributor

Thanks, but it did not work out for me.

I used the ReplaceText with Search Value "[ and Replacement Value of [

Then another ReplaceText with SearchValue ]" and Replacement Value ] and it worked perfect.