CSV

Jump to Section

Converts an event.value that is either an encoded CSV file or an unencoded CSV string, into JSON.

After passing through this stage event.value will hold the parsed CSV. Properties can then be accessed using event.value.myProperty.

For more information on using

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 CSV.

Settings

Delimiter

Specifies the delimiter used to separate headers and fields. The default delimiter is a comma. Only single character delimiters are supported.

Quote

The quote character used by the CSV parser. Defaults to ". Supports the following escaped characters \t (tab), \r (return), \n (newline). Leave this blank to disable quoting.

Escape

The escape character used by the CSV parser. Defaults to \. Supports the following escaped characters \t (tab), \r (return), \n (newline). Leave this blank to disable escaping.

Override Headers

List of headers used to replace the file headers, or provide headers (e.g., header1, header2, header3).

Note: There must be a header for each column of data.

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.