How to create JSON attribute without surrounding double quotes in Nifi

Viewed 1330

I am using the GetTwitter and EvaluateJsonPath processor to extract the hashtags from twitter streaming API, there after I pass the flowfile through a AttributeToJson processor which will create a property named "hashtags" and will append the value of hashtags which is an array like

[{"text":"Ascendant","indices":[0,10]},{"text":"MediumCoeli","indices":[13,25]},{"text":"Cancer","indices":[75,82]},{"text":"Pisces","indices":[103,110]}] 

and append it to the JSON Stream, but this will be enclosed in double quotes in the output of the AttributeToJson processor, ex:

"[{\"text\":\"Ascendant\",\"indices\":[0,10]},{\"text\":\"MediumCoeli\",\"indices\":[13,25]},{\"text\":\"Cancer\",\"indices\":[75,82]},{\"text\":\"Pisces\",\"indices\":[103,110]}]"

How do I get this as a JSON array without the double quotes in the output of the AttributeToJson processor.

1 Answers
Related