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]
Created 06-21-2023 11:15 AM
We are having escaping issues in some expressions. Just an example (using Nifi 1.21.0):
| Expression | Value |
{"$${key}": "value"} | {"${key}": "value"} |
{"$${key}": "${literal('value')}"} | {"$${key}": "value"} |
As one can see, the second expression is not escaping the dollar sign as it should (from the docs, see "Escaping Expression Language"), and just stays as "$$".
Any comments/hints would be much appreciated.
Created 06-21-2023 01:46 PM
@jisaitua
Definitely some weird unexpected behavior there. I was able to reproduce your issue, as well as some other unexpected behavior around same area.
As a workaround to your specific issue, the following NiFi Expression Language (NEL) will get you what you are looking for:
{${literal('')}"$${key}":"${literal('value')}"}
I also filed an Apache NiFi jira for this issue:
https://issues.apache.org/jira/browse/NIFI-11738
I reproduced on an Apache NiFi 1.18 cluster I have running, so it is not an issue that just recently appeared.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt
Created 06-21-2023 04:47 PM
Thank you @MattWho, the trick worked! Sadly, it worked for this simple case, but for more complex cases we couldn't find a pattern to apply it. However, we found another workaround by using literals like this:
| Expression | Value |
{ | { |
It's a nasty hack, but it gets the job done! Thanks again for your help and for filling a bug report.
Created 06-21-2023 01:46 PM
@jisaitua
Definitely some weird unexpected behavior there. I was able to reproduce your issue, as well as some other unexpected behavior around same area.
As a workaround to your specific issue, the following NiFi Expression Language (NEL) will get you what you are looking for:
{${literal('')}"$${key}":"${literal('value')}"}
I also filed an Apache NiFi jira for this issue:
https://issues.apache.org/jira/browse/NIFI-11738
I reproduced on an Apache NiFi 1.18 cluster I have running, so it is not an issue that just recently appeared.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt
Created 06-21-2023 04:47 PM
Thank you @MattWho, the trick worked! Sadly, it worked for this simple case, but for more complex cases we couldn't find a pattern to apply it. However, we found another workaround by using literals like this:
| Expression | Value |
{ | { |
It's a nasty hack, but it gets the job done! Thanks again for your help and for filling a bug report.