JSON
Converts an event.value
that is either an encoded JSON file or a JSON string, into JSON.
After passing through this stage event.value
will hold the parsed JSON. If the JSON was an object, for example, properties could be accessed using event.value.myProperty
.
Incoming Types
File
Processes events that are encoded files. If File Encoding is set to Auto
the file’s BOM will be inspected to determine the encoding type, if the file is missing a BOM this may have to be set explicitly.
String
Processes events that are unencoded stringified JSON.
Custom Error Handling
A stage can be attached to the “failure” path to handle parse failures. In the event that the parse fails the original event will continue down the failure path unchanged, and a new metadata attribute event.metadata.failures
will be added with an array of messages describing why the parse failed.