Support Questions
Find answers, ask questions, and share your expertise

Getting one json file and transform it with NiFi

Explorer

Hi,

I'm a newbie un NiFi world and I'm interested on doing some operations with this tool. I have a JSON file with some fields (Id, Name, Country, time), and I'd like to generate another JSON with only the fields I'm interested in: Id and Name, to load it later on a Casandra DB table. How can I achieve this?

Any help wil be very appreciated 🙂

1 REPLY 1

Super Guru

You can remove fields with any record-based processor, in this case probably ConvertRecord is the most straightforward. You'd use a JsonTreeReader with your incoming schema, and a JsonRecordSetWriter with a schema with the unwanted fields removed. Fields that don't exist in the outgoing schema are not written to the flow file.

; ;