Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Who agreed with this solution

avatar
Super Mentor

@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.

MattWho_0-1620392099103.png

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.

MattWho_1-1620392199474.png

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...

[2] 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

View solution in original post

Who agreed with this solution