Created 07-31-2018 12:14 AM
Hi I'm having problems with trying to replace \u2028 and \u2029 in JSON response using UpdateAttribute processor.
Without replacing this my next processor, ReplaceText , truncates the JSON causing it to become invalid.
Can someone help?
Created 07-31-2018 12:34 AM
Is it possible that, you can add sample input data and expected output?
Created on 07-31-2018 05:11 PM - edited 08-17-2019 10:22 PM
@Shu Trying to do something like the attached, which doesn't work. Also tried the text form
${data:replace("\u2028", "")}
Created 08-01-2018 01:50 AM
It would be lot more easier to have script that can go through the json message (or) attribute values and look for \u2028 character and replace with "".
Sample groovy script to replace the "\u2028"
def st = ' '; println st.replace("\u2028", "hi") Output: hi
Like this way you can have the Groovy/python ..etc script and use ExecuteGroovyScript/ExecuteScript/InvokeScriptedProcessors to execute the script.
For more reference regarding scripting in nifi refer to this link.