nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Campbell <ckcampbell...@live.com>
Subject Question on EvaluateJSONPath
Date Fri, 06 Nov 2015 22:58:56 GMT
I'm converting CSV files to JSON and I want to extract only desired records
from the files based on the first column.

 

I used ConvertCSVtoAvro and then ConvertAvroToJSON that that gave me JSON
output that looks good.

 

[{"field1": "rtapushevq", "field2": "CONFCOAT_SIDE2", "field3": "PVA4",
"field4": "ata", "field5": "NO", "field6": "151030.000027", "field7": "1",
"field8": "28364681B620RR1519501012427601", "field9": "GFE_POWER",
"field10": "GM"},{"field1": "rtapushevq", "field2": "SELSOLDERINSP",
"field3": "SELSOLDERINSP1", "field4": "ata", "field5": "NO", "field6":
"151030.000040", "field7": "1", "field8": "533052945601", "field9":
"CHARGER_LVL", "field10": "BMW"},{"field1": "rtapushevq", "field2":
"LVL_ASSY11", "field3": "LVL_STA11", "field4": "ata", "field5": "NO",

.

 

However, when I try to extract the value of field1 into an attribute using
EvaluateJSONPath (looking at $.field1) it doesn't appear to give me what I
want. I suspect that is because the JSON is formatted as an array rather
than one JSON object per input record. 

 

Can you suggest a way to process the JSON output record-by-record?


Mime
View raw message