Skip to content

write_ndjson

Transforms the input event stream to a Newline-Delimited JSON byte stream.

write_ndjson [strip=bool, color=bool, arrays_of_objects=bool,
strip_null_fields=bool, strip_nulls_in_lists=bool,
strip_empty_records=bool, strip_empty_lists=bool]

Transforms the input event stream to a Newline-Delimited JSON byte stream.

Enables all strip_* options.

Defaults to false.

Colorize the output.

Defaults to false.

Prints the input as a single array of objects, instead of as separate objects.

Defaults to false.

Strips all fields with a null value from records.

Defaults to false.

Strips all null values from lists.

Defaults to false.

Strips empty records, including those that only became empty by stripping.

Defaults to false.

Strips empty lists, including those that only became empty by stripping.

Defaults to false.

load_file "input.yaml"
read_yaml
write_ndjson
save_file "output.json"
from {
yes: 1,
no: null,
}
write_ndjson strip_null_fields=true
{"yes": 1}

parse_ndjson, parse_json, print_ndjson, print_json, read_json, read_ndjson, write_json