Ask Your Question

Revision history [back]

You can manipulate the record with the Expression Evaluator and Field Renamer, then either do the JSON encoding in the destination or use Data Generator.

First, use Expression Evaluator to create the /Data field as an empty map:

image description

Then use Field Renamer to put /field1, /field2 and /field3 under /Data:

image description

This combination will restructure the records as you require:

image description

Now, if you need the JSON as a string, you can use Data Generator to create the JSON, but if you are writing to a file, Kafka etc, you can just set the data format in the destination to JSON.