You can use ExtractText processor to extract elements of Array then using Update attribute and ReplaceText processor we can create the final json.
Flow:
1.ExtractText //add new property with regex expression to extract a,1
2.ReplaceText //always replace as replacement strategy and use nifi expression language to prepare json.
(or)
Use the approach specified in this article 2.2 to iterate through array of elements and then use nifi expression language to create output flowfile in json format using ReplaceText processor.