The Flatten Function
Description
The Flatten Function is used to flatten fields out of a nested structure. Let's flatten the _raw JSON object, to further reduce the event's size before we send it to the intended destination(s).
Steps – Adding a Flatten Function
important
- Select the
Add Functionbutton at the top right. - In the search bar, type
flatten, and select theFlattenFunction. It will be added at the bottom of the Pipeline. - We don't need to change this Function's default configuration, so just select
Save.

Results
The nested JSON fields have been flattened to top-level fields below _raw.

note
Don't worry about the _raw field's deletion (red strikeout). This is the Flatten Function's default behavior. We'll restore _raw after we clean and reduce the event even more.
The flattened field names are lengthy and confusing. Let's rename them with the Rename Function.