- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Generate Separate UUID for JSON array of objects
- Labels:
-
Apache NiFi
Created on
03-16-2020
08:44 AM
- last edited on
03-16-2020
01:11 PM
by
ask_bill_brooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am trying to generate separate UUID for JSON array of objects. I tried to use ${UUID()} in JOLT specification, but this is generating same UUID for all the elements.
e.g.
Input:
===============
{
"aliases": [
"Alias1",
" Alias2"
]
}
JOLT Specification
=====================
[
{
"operation": "shift",
"spec": {
"aliases": {
"*": "alias[&0].name"
}
}
},
{
"operation": "modify-default-beta",
"spec": {
"alias": {
"*": {
"id": "${UUID()}"
}
}
}
}
]
Current Output:
=====================
"alias" : [ {
"name" : "Alias1",
"id" : "2948446b-6213-44ba-b81f-c4e5f7dab2eb"
}, {
"name" : " Alias2",
"id" : "2948446b-6213-44ba-b81f-c4e5f7dab2eb"
} ]
Any pointers will be greatly appreciated.
Thanks,
Biswa
Created on 07-04-2020 04:28 AM - edited 07-04-2020 04:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Refer to the post here
