Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Getting Json Array Field value into CSV format

Highlighted

Getting Json Array Field value into CSV format

New Contributor

Hi,

I have a JSON record like given below,

{
    "entitlement": {
        "packageCodes": ["A", "B", "C"],
        "accountToken": "accountTokenXYZ",
        "creationDate": "2018-08-03 11:58:54",
        "lastModifiedDate": "2019-04-23 11:58:03",
        "status": "ACTV",
        "expirationDate": null
    },
    "op_type": "U",
    "op_ts": "2019-05-08 03:41:07.007764",
    "table": "tablename"
}


Expected Output:

PackageCodes,accountToken,creationDate,lastModifiedDate,status,expirationDate,op_type,op_ts,table
"A,B,C",accountTokenXYZ,2018-08-03 11:58:54,2019-04-23 11:58:03,ACTV,,U,2019-05-08 03:41:07.007764,tablename


How this can be achieved using NiFi?


Please help.


Thanks,

Bala.