@Ishant Kathuria
For your expected output Jolt Spec would be
[
{
"operation": "shift",
"spec": {
"Rating": "rating-primary", //change Rating name to rating-primary
"SecondaryRatings": { //append rating- for all SecondaryRatings list
"*": "rating-&"
}
}
}
]
Input:-
{
"Rating": 1,
"SecondaryRatings": {
"Design": 4,
"Price": 2,
"RatingDimension3": 1
}
}
Output:-
{
"rating-primary" : 1,
"rating-Design" : 4,
"rating-Price" : 2,
"rating-RatingDimension3" : 1
}
Jolt Configs:-

Jolt Spec Validation:-
If you want to test your jolt spec
Right Click on JOLTTransformJSON processor and click on Advanced left down corner. you can specify your SPEC, input and we can validate the spec.

(or)
Click on this link.
Please refer to below community Questions/Articles for tutorials.
https://community.hortonworks.com/questions/137782/nifi-explode-a-json-array-while-keeping-root-leve...
https://community.hortonworks.com/questions/147362/jolttransformjson-spec.html
https://community.hortonworks.com/questions/152046/nifi-how-to-use-jolt-to-add-json-keyvalue-dynamic...
https://community.hortonworks.com/articles/105965/expression-language-with-jolt-in-apache-nifi.html
https://community.hortonworks.com/articles/44726/json-to-json-simplified-with-apache-nifi-and-jolt.h...
http://ijokarumawak.github.io/nifi/2016/11/22/nifi-jolt/
.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.