Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Replace Multiple Character with UpdateRecord in Apache NiFi

avatar
New Contributor

Hi,

All I want to do is replace multiple character in a field's value.

The text in the field is:

'I have different characters'

If I try ${field.value:replace('a', 'i')} it works. The output is 'I hive different chiricters'

 

Bu I want to replace one more character. How can I do this in same processor.

I have tried someting like ${field.value:raplace('a', 'i'); field.value:replace('e', 'u')}

 

I couln't find the right syntax. Please help.

1 ACCEPTED SOLUTION

avatar
Super Guru

Hi ,

I think the right  syntax will be :

${field.value:raplace('a', 'i'):replace('e', 'u'):replace(...)}

Hope that helps.

Thanks

View solution in original post

3 REPLIES 3

avatar
Super Guru

Hi ,

I think the right  syntax will be :

${field.value:raplace('a', 'i'):replace('e', 'u'):replace(...)}

Hope that helps.

Thanks

avatar
New Contributor

Thank you Samsal. I have tried different combinations but I am suprised I did not try this one. This is javascript syntax, right? If I learn beginner level javascript, is it going to be easier to use NiFi's expression language?

avatar
Super Guru

Hi,

You dont need to have programming language to learn Expression Language. It can help but its not required.