I'm using the NIFI ExtractText Processor and I'm trying to come up with the regular expression to extract values from a JSON String that is in the flowfile-content coming from a response of an API (of course I cannot change how the API responds).
JSON Data returned from the REST API is:
{
"Result" : {
"SessionID" : null,
"ResultData" : {
"DATAENTITYNAME" : "List",
"CURRENTCURSORPOSITION" : 2,
"DATARECORD" : [ {
"DATAFIELD" : [ {
"FIELDNAME" : "name",
"FIELDLABEL" : "Name",
"DATATYPE" : "VARCHAR",
"FIELDVALUE" : "JSMITH",
"ISKEYFIELD" : true
}, {
"FIELDNAME" : "namedesc",
"FIELDLABEL" : "Name Desc.",
"DATATYPE" : "MIXVARCHAR",
"FIELDVALUE" : "John Smith",
"ISKEYFIELD" : false
}, {
"FIELDNAME" : "hireddate",
"FIELDLABEL" : "Hired Date",
"DATATYPE" : "DATE",
"FIELDVALUE" : "01-JAN-2010",
"ISKEYFIELD" : false
}]
}, {
"DATAFIELD" : [ {
"FIELDNAME" : "name",
"FIELDLABEL" : "Name",
"DATATYPE" : "VARCHAR",
"FIELDVALUE" : "RSTONE",
"ISKEYFIELD" : true
}, {
"FIELDNAME" : "namedesc",
"FIELDLABEL" : "Name Desc.",
"DATATYPE" : "MIXVARCHAR",
"FIELDVALUE" : "Robert Stone",
"ISKEYFIELD" : false
}, {
"FIELDNAME" : "hireddate",
"FIELDLABEL" : "Hired Date",
"DATATYPE" : "DATE",
"FIELDVALUE" : "01-JAN-2011",
"ISKEYFIELD" : false
}]
},
},
"InfoAlert" : null,
"WarningAlert" : null
},
"ConfirmationAlert" : null,
"ErrorAlert" : [ ]
}
How do I get all "name" and "namedesc"? (in the example: JSMITH -> John Smith and RSTONE -> Robert Stone)
Thanks!!!!!