Created on 01-09-2020 10:50 AM - last edited on 01-09-2020 11:12 AM by cjervis
Hi,
I am receiving the flowfile from ConsumerKafka in json form.
Then I am using EvaluateJsonPath to extract the json data once the data matched, i want call RouteOnAttribute to call script, but the expression which i have used in EvaluateJsonPath processor looks to be wrong and throwing out unmatched info.
Plz help me out to add right expression to extract the fields
Created 01-09-2020 11:07 AM
Based on your content, the values are accessed as follows:
$.HR.finance.name
$.HR.finance.age
Created 01-09-2020 11:07 AM
Based on your content, the values are accessed as follows:
$.HR.finance.name
$.HR.finance.age
Created 01-09-2020 11:17 AM
ohh my BAD, thank you Steven.
Created 01-09-2020 11:43 AM
Hi Steven,
I doing a poc(learning nifi and doing it), getting the data successfully from EvaluteJasonPath its going to matched processor with the only extracted data, but the flow file is missing when it is going to RouteOnAttribute, I could see only data extracted present but total flow file is missing, because of this my condition is not getting validated and going to unmatched status.
Created on 01-09-2020 01:37 PM - edited 01-09-2020 01:42 PM
In the routeonattribute proc you use just the ${attribute:equals(‘value’)} that you parsed from evaluatejson proc.
Evaluatejson:
attribute = $.HR.finance.name
RouteOnAttribute
${attribute:equals(‘Murali’)}
Created 01-09-2020 07:12 PM
Hi Steven,
Great Thank full to you, I tried the workaround but its failed, the problem is the attribute is not coming out from EvaluateJasonPath, the attribute which I supposed to use in RouteOnAttribute for comparison.
The following is the output of attributes property file from EvalueJasonPath processor.
If I get attribute HR.finance.user from EvaluateJasonPath, then i can use that attribute in RouteOnAttribute for comparison of attribute value.
Created 01-10-2020 03:17 AM
The issue is I was not using right value for the attribute Destination, the value suppose to be flowfile-attribute in my case.
Thanks Steven for suggestions.
Created 01-10-2020 05:05 AM
Ahh I did not pay attention to that in the original screen shot, just tried to offer the syntax for the json parsing. Glad you got it to work! Isn't learning NiFi fun? I love it.