<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt) in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386074#M245935</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/109891"&gt;@Nicanor&lt;/a&gt;,&amp;nbsp;Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&amp;nbsp;who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 08:35:10 GMT</pubDate>
    <dc:creator>VidyaSargur</dc:creator>
    <dc:date>2024-04-04T08:35:10Z</dc:date>
    <item>
      <title>Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386012#M245928</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to convert json data with both Object and Array into Object at once.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I used jolt, but I didn't reach the desired result.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The json data is as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Input Data:&lt;/P&gt;&lt;PRE&gt;{
  "response": {
    "header": {
      "resultCode": "00",
      "resultMsg": "NORMAL_SERVICE"
    },
    "body": {
      "dataType": "XML",
      "items": {
        "item": {
          "icaoCode": null,
          "airportName": null,
          "metarMsg": {
            "METAR": {
              "automatedStation": false,
              "id": "metar-RKSS-20240404000000Z",
              "permissibleUsage": "OPERATIONAL",
              "status": "NORMAL",
              "schemaLocation": "link data link data link data link data link data",
              "extension": {
                "msgText": "METAR RKSS 040000Z 09007KT 030V120 9999 SCT035 BKN150 15/05&amp;amp;#13;\n          Q1015 NOSIG="
              },
              "observation": {
                "OM_Observation": {
                  "id": "obs-RKSS-20240404000000Z",
                  "type": {
                    "href": "link data"
                  },
                  "phenomenonTime": {
                    "TimeInstant": {
                      "id": "ti-20240404000000Z",
                      "timePosition": "2024-04-04T00:00:00Z"
                    }
                  },
                  "resultTime": {
                    "href": "#ti-20240404000000Z"
                  },
                  "procedure": {
                    "Process": {
                      "id": "p-49-2-metar",
                      "description": "WMO No. 49 Volume 2 Meteorological Service for International Air Navigation APPENDIX 3 TECHNICAL SPECIFICATIONS RELATED TO METEOROLOGICAL OBSERVATIONS AND REPORTS"
                    }
                  },
                  "observedProperty": {
                    "href": "link data"
                  },
                  "featureOfInterest": {
                    "SF_SpatialSamplingFeature": {
                      "id": "sp-RKSS",
                      "type": {
                        "href": "link data"
                      },
                      "sampledFeature": {
                        "AirportHeliport": {
                          "id": "aerodrome-RKSS",
                          "timeSlice": {
                            "AirportHeliportTimeSlice": {
                              "id": "aerodrome-RKSS-ts",
                              "validTime": null,
                              "interpretation": "BASELINE",
                              "designator": "RKSS",
                              "name": "GIMPO INTERNATIONAL AIRPORT",
                              "locationIndicatorICAO": "RKSS"
                            }
                          }
                        }
                      },
                      "shape": {
                        "Point": {
                          "axisLabels": "Latitude Longitude Altitude",
                          "id": "obs-point-RKSS",
                          "srsName": "link data",
                          "uomLabels": "deg deg m",
                          "pos": "37.33 126.48 18.0"
                        }
                      }
                    }
                  },
                  "result": {
                    "MeteorologicalAerodromeObservationRecord": {
                      "cloudAndVisibilityOK": false,
                      "id": "observation-record-RKSS-20240404000000Z",
                      "airTemperature": {
                        "uom": "Cel",
                        "$": 15
                      },
                      "dewpointTemperature": {
                        "uom": "Cel",
                        "$": 5
                      },
                      "qnh": {
                        "uom": "hPa",
                        "$": 1015
                      },
                      "surfaceWind": {
                        "AerodromeSurfaceWind": {
                          "variableWindDirection": false,
                          "meanWindDirection": {
                            "uom": "deg",
                            "$": 90
                          },
                          "meanWindSpeed": {
                            "uom": "[kn_i]",
                            "$": "007"
                          },
                          "extremeClockwiseWindDirection": {
                            "uom": "deg",
                            "$": 120
                          },
                          "extremeCounterClockwiseWindDirection": {
                            "uom": "deg",
                            "$": "030"
                          }
                        }
                      },
                      "visibility": {
                        "AerodromeHorizontalVisibility": {
                          "prevailingVisibility": {
                            "uom": "m",
                            "$": 10000
                          }
                        }
                      },
                      "cloud": {
                        "AerodromeObservedClouds": {
                          "layer": [
                            {
                              "CloudLayer": {
                                "amount": {
                                  "href": "link data"
                                },
                                "base": {
                                  "uom": "[ft_i]",
                                  "$": 3500
                                },
                                "cloudType": {
                                  "href": "link data",
                                  "title": "Stratocumulus"
                                }
                              }
                            },
                            {
                              "CloudLayer": {
                                "amount": {
                                  "href": "link data"
                                },
                                "base": {
                                  "uom": "[ft_i]",
                                  "$": 15000
                                },
                                "cloudType": {
                                  "href": "link data",
                                  "title": "Altocumulus"
                                }
                              }
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "trendForecast": {
                "OM_Observation": {
                  "id": "trend-fcst-1",
                  "type": {
                    "href": "link data"
                  },
                  "phenomenonTime": {
                    "href": "#ti-20240404000000Z"
                  },
                  "resultTime": {
                    "href": "#ti-20240404000000Z"
                  },
                  "procedure": {
                    "href": "#p-49-2-metar"
                  },
                  "observedProperty": {
                    "href": "link data"
                  },
                  "featureOfInterest": {
                    "href": "#sp-RKSS"
                  },
                  "result": {
                    "MeteorologicalAerodromeTrendForecastRecord": {
                      "changeIndicator": "NO_SIGNIFICANT_CHANGES",
                      "cloudAndVisibilityOK": false,
                      "id": "trend-fcst-record-1-20240404000000Z"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "numOfRows": 10000,
      "pageNo": 1,
      "totalCount": 1
    }
  }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jolt Spec:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[
  {
    "operation": "shift",
    "spec": {
      "response": {
        "body": {
          "items": {
            "item": {
              "*": {
                "*": {
                  "extension": {
                    "msgText": "msgText"
                  },
                  "observation": {
                    "OM_Observation": {
                      "phenomenonTime": {
                        "TimeInstant": {
                          "timePosition": "phenomenonTime"
                        }
                      },
                      "featureOfInterest": {
                        "SF_SpatialSamplingFeature": {
                          "sampledFeature": {
                            "AirportHeliport": {
                              "timeSlice": {
                                "AirportHeliportTimeSlice": {
                                  "name": "featureOfInterest"
                                }
                              }
                            }
                          },
                          "shape": {
                            "Point": {
                              "pos": "shape"
                            }
                          }
                        }
                      },
                      "result": {
                        "MeteorologicalAerodromeObservationRecord": {
                          "airTemperature": {
                            "\\$": "airTemperature"
                          },
                          "dewpointTemperature": {
                            "\\$": "dewpointTemperature"
                          },
                          "qnh": {
                            "\\$": "qnh"
                          },
                          "surfaceWind": {
                            "AerodromeSurfaceWind": {
                              "meanWindDirection": {
                                "\\$": "meanWindDirection"
                              },
                              "meanWindSpeed": {
                                "\\$": "meanWindSpeed"
                              },
                              "windGustSpeed": {
                                "\\$": "windGustSpeed"
                              },
                              "extremeClockwiseWindDirection": {
                                "\\$": "extremeClockwiseWindDirection"
                              },
                              "extremeCounterClockwiseWindDirection": {
                                "\\$": "extremeCounterClockwiseWindDirection"
                              }
                            }
                          },
                          "visibility": {
                            "AerodromeHorizontalVisibility": {
                              "prevailingVisibility": {
                                "\\$": "AerodromeHorizontalVisibility"
                              }
                            }
                          },
                          "presentWeather": {
                            "href": "presentWeather"
                          },
                          "cloud": {
                            "AerodromeObservedClouds": {
                              "layer": {
                                "*": {
                                  "CloudLayer": {
                                    "amount": {
                                      "href": "cloud_amount"
                                    },
                                    "base": {
                                      "\\$": "cloud_base"
                                    },
                                    "cloudType": {
                                      "href": "cloudType_href",
                                      "title": "cloudType"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    },
  {
    "operation": "shift",
    "spec": {
      "msgText": "&amp;amp;",
      "phenomenonTime": "&amp;amp;",
      "featureOfInterest": "&amp;amp;",
      "shape": "&amp;amp;",
      "airTemperature": "&amp;amp;",
      "dewpointTemperature": "&amp;amp;",
      "qnh": "&amp;amp;",
      "meanWindDirection": "&amp;amp;",
      "meanWindSpeed": "&amp;amp;",
      "windGustSpeed": "&amp;amp;",
      "extremeClockwiseWindDirection": "&amp;amp;",
      "extremeCounterClockwiseWindDirection": "&amp;amp;",
      "AerodromeHorizontalVisibility": "&amp;amp;",
      "cloud_amount": "&amp;amp;",
      "cloud_base": "&amp;amp;",
      "cloudType_href": "&amp;amp;",
      "cloudType": "&amp;amp;",
      "presentWeather": "&amp;amp;"
    }
   },
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      "airTemperature": "=toString",
      "dewpointTemperature": "=toString",
      "qnh": "=toString",
      "meanWindDirection": "=toString",
      "meanWindSpeed": "=toString",
      "extremeClockwiseWindDirection": "=toString",
      "extremeCounterClockwiseWindDirection": "=toString",
      "AerodromeHorizontalVisibility": "=toString",
      "cloud_amount": "=toString",
      "cloud_base": "=toString",
      "cloudType_href": "=toString",
      "cloudType": "=toString"
    }
  }



  ]&lt;/PRE&gt;&lt;P&gt;OutPut Data:&lt;/P&gt;&lt;PRE&gt;{
  "msgText" : "METAR RKSS 040000Z 09007KT 030V120 9999 SCT035 BKN150 15/05&amp;amp;#13;\n          Q1015 NOSIG=",
  "phenomenonTime" : "2024-04-04T00:00:00Z",
  "featureOfInterest" : "GIMPO INTERNATIONAL AIRPORT",
  "shape" : "37.33 126.48 18.0",
  "airTemperature" : "15",
  "dewpointTemperature" : "5",
  "qnh" : "1015",
  "meanWindDirection" : "90",
  "meanWindSpeed" : "007",
  "extremeClockwiseWindDirection" : "120",
  "extremeCounterClockwiseWindDirection" : "030",
  "AerodromeHorizontalVisibility" : "10000",
  "cloud_amount" : [ "link data", "link data" ],
  "cloud_base" : [ "3500", "15000" ],
  "cloudType_href" : [ "link data", "link data" ],
  "cloudType" : [ "Stratocumulus", "Altocumulus" ]
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expected data:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;{
  "msgText" : "METAR RKSS 040000Z 09007KT 030V120 9999 SCT035 BKN150 15/05&amp;amp;#13;\n          Q1015 NOSIG=",
  "phenomenonTime" : "2024-04-04T00:00:00Z",
  "featureOfInterest" : "GIMPO INTERNATIONAL AIRPORT",
  "shape" : "37.33 126.48 18.0",
  "airTemperature" : "15",
  "dewpointTemperature" : "5",
  "qnh" : "1015",
  "meanWindDirection" : "90",
  "meanWindSpeed" : "007",
  "extremeClockwiseWindDirection" : "120",
  "extremeCounterClockwiseWindDirection" : "030",
  "AerodromeHorizontalVisibility" : "10000",
  "cloud_amount0" : "link data",
  "cloud_amount1" : "link data"
  "cloud_base0" : "3500",
  "cloud_base1" : "15000",
  "cloudType_href0" : "link data",
  "cloudType_href1" : "link data",
  "cloudType0" : "Stratocumulus",
  "cloudType1" : "Altocumulus"
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As above, could you please advise a jolt script in which the data I expect is output?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 02:11:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386012#M245928</guid>
      <dc:creator>Nicanor</dc:creator>
      <dc:date>2024-04-04T02:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386074#M245935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/109891"&gt;@Nicanor&lt;/a&gt;,&amp;nbsp;Welcome to our community! To help you get the best possible answer, I have tagged in our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&amp;nbsp;who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 08:35:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386074#M245935</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2024-04-04T08:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386084#M245937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/109891"&gt;@Nicanor&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can bring another&amp;nbsp;&lt;SPAN&gt;JoltTransformJSON processor and write down the below JOLT spec to extract the element of list.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;JOLT Spec&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "msgText": "&amp;amp;",
      "phenomenonTime": "phenomenonTime",
      "cloud_base": "cloud_base_List",
      "cloud_amount": "cloud_amount_List"
    }
  },
  // Extracting Values from the List 
  {
    "operation": "modify-overwrite-beta",
    "spec": {
      // Extract the last element from each list
      "cloud_base1": "=lastElement(@(1,cloud_base_List))",
      "cloud_base2": "=firstElement(@(1,cloud_base_List))"
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;JOLT Output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "msgText" : "METAR RKSS 040000Z 09007KT 030V120 9999 SCT035 BKN150 15/05&amp;amp;#13;\n          Q1015 NOSIG=",
  "phenomenonTime" : "2024-04-04T00:00:00Z",
  "cloud_base_List" : [ 3500, 15000 ],
  "cloud_amount_List" : [ "link data", "link data" ],
  "cloud_base1" : 15000,
  "cloud_base2" : 3500
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more suggestion, please remove the unrequired line of code. you can typecast the data type by using UpdateRecord processor. &amp;nbsp;Because JOLT transformation may consume large amounts of memory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "response": {
        "body": {
          "items": {
            "item": {
              "*": {
                "*": {
                  "extension": {
                    "msgText": "msgText"
                  },
                  "observation": {
                    "OM_Observation": {
                      "phenomenonTime": {
                        "TimeInstant": {
                          "timePosition": "phenomenonTime"
                        }
                      },
                      "featureOfInterest": {
                        "SF_SpatialSamplingFeature": {
                          "sampledFeature": {
                            "AirportHeliport": {
                              "timeSlice": {
                                "AirportHeliportTimeSlice": {
                                  "name": "featureOfInterest"
                                }
                              }
                            }
                          },
                          "shape": {
                            "Point": {
                              "pos": "shape"
                            }
                          }
                        }
                      },
                      "result": {
                        "MeteorologicalAerodromeObservationRecord": {
                          "airTemperature": {
                            "\\$": "airTemperature"
                          },
                          "dewpointTemperature": {
                            "\\$": "dewpointTemperature"
                          },
                          "qnh": {
                            "\\$": "qnh"
                          },
                          "surfaceWind": {
                            "AerodromeSurfaceWind": {
                              "meanWindDirection": {
                                "\\$": "meanWindDirection"
                              },
                              "meanWindSpeed": {
                                "\\$": "meanWindSpeed"
                              },
                              "windGustSpeed": {
                                "\\$": "windGustSpeed"
                              },
                              "extremeClockwiseWindDirection": {
                                "\\$": "extremeClockwiseWindDirection"
                              },
                              "extremeCounterClockwiseWindDirection": {
                                "\\$": "extremeCounterClockwiseWindDirection"
                              }
                            }
                          },
                          "visibility": {
                            "AerodromeHorizontalVisibility": {
                              "prevailingVisibility": {
                                "\\$": "AerodromeHorizontalVisibility"
                              }
                            }
                          },
                          "presentWeather": {
                            "href": "presentWeather"
                          },
                          "cloud": {
                            "AerodromeObservedClouds": {
                              "layer": {
                                "*": {
                                  "CloudLayer": {
                                    "amount": {
                                      "href": "cloud_amount"
                                    },
                                    "base": {
                                      "\\$": "cloud_base"
                                    },
                                    "cloudType": {
                                      "href": "cloudType_href",
                                      "title": "cloudType"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    }
  ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"Accept as Solution" if its work for you.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 10:04:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386084#M245937</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-04T10:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386143#M245953</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you for your solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It was a lot of inspiration for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore, I would like to ask you another question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expected data:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;{
  "cloud_amount0" : "link data0",
  "cloud_amount1" : "link data1",&lt;BR /&gt;  "cloud_amount2" : "link data2",&lt;BR /&gt;  "cloud_amount3" : "link data3",
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Is there a jolt whose key name is dynamically increasing like &lt;STRONG&gt;'cloud_mount'&lt;/STRONG&gt;?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 04:15:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386143#M245953</guid>
      <dc:creator>Nicanor</dc:creator>
      <dc:date>2024-04-05T04:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386203#M245966</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/109891"&gt;@Nicanor&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Could you please provide the JSON input also?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 18:24:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386203#M245966</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-05T18:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Apache NiFi : How to change JSON data with both Object and Array to Object at once. (Use jolt)</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386206#M245968</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/109891"&gt;@Nicanor&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Let's take a below example:&lt;/P&gt;&lt;P&gt;Json Input:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "cloud_base": [
      "3500",
      "15000"
    ],
    "cloudType": [
      "Stratocumulus",
      "Altocumulus"
    ]
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;Jolt Spec:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
  {
    "operation": "shift",
    "spec": {
      "*": {
        "cloud_base": {
          "*": {
            "*": {
              "@1": "cloud_base_&amp;amp;"
            }
          }
        },
        "cloudType": {
          "*": {
            "*": {
              "@1": "cloudType_&amp;amp;"
            }
          }
        }
      }
    }
  }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "cloud_base_3500" : "3500",
  "cloud_base_15000" : "15000",
  "cloudType_Stratocumulus" : "Stratocumulus",
  "cloudType_Altocumulus" : "Altocumulus"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"Accept as Solution" if its work for you.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 19:27:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-NiFi-How-to-change-JSON-data-with-both-Object-and/m-p/386206#M245968</guid>
      <dc:creator>saquibsk</dc:creator>
      <dc:date>2024-04-05T19:27:13Z</dc:date>
    </item>
  </channel>
</rss>

