JoltTransformJSON processor in NiFi(json without any parent tag)
Date : March 29 2020, 07:55 AM
hop of those help? The trick is to walk back up the tree until you get to the element in the array, then you can reference that index in the target. Try this spec: [
{
"operation": "shift",
"spec": {
"*": {
"Header": {
"recordNum": "[&2].recordNum",
"readOn": "[&2].&1.created_date_time",
"fileName": "[&2].&1.readFile"
},
"Data": {
"id": "[&2].&1.Id",
"first_name": "[&2].&1.First_Name",
"last_name": "[&2].&1.Last_Name"
}
}
}
}
]
|
Nifi JoltTransformJSON : Keeping the underscore sign in key name
Date : March 29 2020, 07:55 AM
hope this fix your issue I think the underscore might be some kind of special character in that operator, try double-backslashes in front of _Source: [
{
"operation": "shift",
"spec": {
"user_name": "userName"
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"\\_Source": {
"userName": "@(2,userName)"
}
}
},
{
"operation": "remove",
"spec": {
"userName": ""
}
}
]
|
JoltTransformJSON processor in NiFi
Tag : json , By : evegter
Date : March 29 2020, 07:55 AM
seems to work fine Input: , Try below example: [
{
"operation": "shift",
"spec": {
"table": {
// table items
"*": {
// internal object in item under "_id" key
"*": "table[]"
}
}
}
}
]
|
NiFi JoltTransformJSON
Date : March 29 2020, 07:55 AM
|
Apache NiFi JoltTransformJSON processor attribute as jolt spec
Date : March 29 2020, 07:55 AM
Any of those help Jolt Specification supports NiFi Expression Language but only for substituting the values inside the spec. That is: Say you have a NiFi attribute : jolt.operation: shift you can refer that inside your spec as: [
{
"operation" : ${jolt.operation},
...
...
}
]
|