You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by KhajaAsmath Mohammed <md...@gmail.com> on 2020/10/04 14:32:30 UTC
NIFI - Flatten JOSN and entire JSON record to database
Hi,
I am stuck with implementation where I need to load the entire JSON data
into database using NIFI. I was able to flatten json and load it but at the
same time I need to load the entire text of JSON into other field.
Here is the approach I tried.
Load entire json into attribute using extractext processor
FLatten json
JOLT transformation on flatten json and add attribute of entire json.
Error: Unmarshal error
Here is the JSON that i am looking for . any suggestions pelase?
{
"sensor": "http://canvas.wic.edu/",
"sendTime": "2020-10-02T17:58:51.747Z",
"dataVersion": "http://purl.imsglobal.org/ctx/caliper/v1p1",
"data": [
{
"@context": "http://purl.imsglobal.org/ctx/caliper/v1p1",
"id": "urn:uuid:0972f27d-4b87-4e8e-90a0-40f10968820f",
"type": "NavigationEvent",
"actor": {
"id": "urn:instructure:canvas:user:131710000000064254",
"type": "Person",
"extensions": {
"com.instructure.canvas": {
"user_login": "jstachow",
"user_sis_id": "A15397698",
"root_account_id": "131710000000000001",
"root_account_lti_guid":
"YYzs3up2ikmNIyNSel3biohOBqVtaOJCALBEKdzq:canvas-lms",
"root_account_uuid":
"YYzs3up2ikmNIyNSel3biohOBqVtaOJCALBEKdzq",
"entity_id": "131710000000064254"
}
}
},
"action": "NavigatedTo",
"object": {
"id": "urn:instructure:canvas:wikiPage:131710000000084157",
"type": "Page",
"extensions": {
"com.instructure.canvas": {
"asset_name": "Zoom",
"asset_type": "wiki_page",
"entity_id": "131710000000084157",
"context_account_id": "131710000000000291",
"http_method": "GET"
}
}
},
"eventTime": "2020-10-02T17:58:50.700Z",
"referrer": "https://canvas.wic.edu/courses/19278/modules",
"edApp": {
"id": "http://canvas.wic.edu/",
"type": "SoftwareApplication"
},
"group": {
"id": "urn:instructure:canvas:course:131710000000019278",
"type": "CourseOffering",
"extensions": {
"com.instructure.canvas": {
"context_type": "Course",
"entity_id": "131710000000019278"
}
}
},
"membership": {
"id":
"urn:instructure:canvas:course:131710000000019278:Learner:131710000000064254",
"type": "Membership",
"member": {
"id": "urn:instructure:canvas:user:131710000000064254",
"type": "Person"
},
"organization": {
"id": "urn:instructure:canvas:course:131710000000019278",
"type": "CourseOffering"
},
"roles": [
"Learner"
]
},
"session": {
"id":
"urn:instructure:canvas:session:4afdd42062c3e4b4ef3be57ef4e6745d",
"type": "Session"
},
"extensions": {
"com.instructure.canvas": {
"hostname": "canvas.wic.edu",
"request_id": "ae0dc534-19a4-49ce-b10b-adf4e7ee1602",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
"client_ip": "68.252.124.155",
"request_url": "
https://canvas.wic.edu/courses/19278/pages/zoom?module_item_id=526508",
"version": "1.0.0"
}
}
}
]
}
Thanks,
Asmath