write_xsv
Transforms event stream to XSV byte stream.
write_xsv field_separator=str, list_separator=str, null_value=str, [no_header=bool]
Description
Section titled “Description”The xsv
format is a generalization of comma-separated values (CSV) data
in tabular form with a more flexible separator specification supporting tabs,
commas, and spaces. The first line in an XSV file is the header that describes
the field names. The remaining lines contain concrete values. One line
corresponds to one event, minus the header.
The following table lists existing XSV configurations:
Format | Field Separator | List Separator | Null Value |
---|---|---|---|
csv | , | ; | empty |
ssv | <space> | , | - |
tsv | \t | , | - |
Note that nested records have dot-separated field names.
field_separator = str
Section titled “field_separator = str”The string separating different fields.
list_separator = str
Section titled “list_separator = str”The string separating different elements in a list within a single field.
null_value = str
Section titled “null_value = str”The string denoting an absent value.
no_header=bool (optional)
Section titled “no_header=bool (optional)”Whether to not print a header line containing the field names.
Examples
Section titled “Examples”from {x:1, y:true, z: "String"}write_xsv field_separator="/", list_separator=";", null_value=""
x/y/z1/true/String