Member since
03-19-2018
2
Posts
4
Kudos Received
0
Solutions
03-19-2018
03:40 PM
2 Kudos
@Shu Thanks for your answer. I understand that there are ways to work around this issue. I also did that using the second method. However, isn't this simply a bug? The module states it is able to work with the NiFi expression language, so why is it not working for all expressions? Shouldn't this be taken care of? That way we don't have to work around this issue.
... View more
03-19-2018
12:03 PM
2 Kudos
Hi,
I want to use the replace text processor to replace some text. Main goals is to escape JSON, however, it seems that both escapeJson() and replaceText() don't work. Other expressions (like notNull and substring) do seem to work.
The replaceText processor has the following settings configured:
Search value: (?s)(^.*$)
Replacement value: ${'$1':escapeJson()}
Replacement strategy: Regex replace
Evaluation mode: Entire text
I noticed that when I use the notNull() expression, it replaces the text with True, and when i use substring(0, 5) it gives me the first 5 characters. However, when using escapeJson() or replace('"', '\\"') it doesn't replace quotes or slashes.
An example text value that I used: https 2018-03-18T23:55:36.990541Z app/abc-pxx-p001/abc123 12.34.56.78:12345 87.65.43.21:80 0.000 0.092 0.000 200 200 1124 364 "GET https://mysite.nl:443/test HTTP/1.1" "abc/1 CFN/987 Darwin/12.3.4" ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 arn:aws:elasticloadbalancing:eu-west-1:012345679:targetgroup/abc-external-abc-de/abc123def456 "Root=1-5a-d2a18df071c" "mysite.nl" "session-reused" 0
... View more