- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Not getting Expected output Using Jolt in NiFi
- Labels:
-
Apache NiFi
Created ‎01-09-2023 11:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
I am using Jolt for the input:
{
"headers": {
"query": "NA",
"param": "false"
},
"data": [
{
"SEQ_NUM": [
162,
162,
162,
162,
162,
162,
162,
162
]
},
{
"SEQ_NUM": [
162,
162,
162,
162,
162,
162,
162,
162
]
}
]
}
Jolt Spec:
[{
"operation": "shift",
"spec": {
"data": {
"*": {
"SEQ_NUM": {
"*": {
"@": "[&1].SEQ_NUM"
}
}
}
}
}
}
]
Output:
[ {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
}, {
"SEQ_NUM" : [ 162, 162 ]
} ]
Expected Output:
[ {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
}, {
"SEQ_NUM" : 162
} ]
Can you please help me with the same.
Thank you
Created ‎01-10-2023 01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Techie123,
can you tell a bit more about what you want to achive?
Do you want just use the first or second object of 'data'?
Then you have to change:
"data": {
"0": {
"data": {
"1": {
Or how do you want to progress - can it that the numbers are not similiar?
We dont know how your results can be look like
Greetings
Created ‎01-10-2023 01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Techie123,
can you tell a bit more about what you want to achive?
Do you want just use the first or second object of 'data'?
Then you have to change:
"data": {
"0": {
"data": {
"1": {
Or how do you want to progress - can it that the numbers are not similiar?
We dont know how your results can be look like
Greetings
