Created 05-07-2021 06:03 AM
@leandrolinof
The "EvaluateJsonPath" processor you shared has the configured destination as a FlowFile-Attribute and thus leaves the content of the FlowFile unchanged.
So if FlowFile Attribute is where you want this parsed output to reside, you could use "ExtractText" [1] as an alternative solution.
The used value here would be:
.*Erros":\[(.*)\].*
This has only 1 capture group which is for the content you are trying to extract. That content is then added to the FlowFile in a new FlowFile attribute based on the property name.
If you instead want to replace the content of your FlowFile with only the portion of the original content you are trying to extract, you could use the "ReplaceText" [2] processor.
The used Java regex "Search value" here would be:
(.*Erros":\[)(.*)(\].*$)
Which breaks source content into 3 capture groups so regex matches entire content and capture group 2 matches on the string output you are looking for.
So "Replacement Value" is simply set to "$2" so that entire content is replaced with just contents of capture group 2.
[1] http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.13.2/org.apache...
If you found this help you with your question, please take a moment to login and click accept on this solution.
Thanks,
Matt