Skip to content

write_json

Transforms the input event stream to a JSON byte stream.

write_json [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 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_json
save_file "output.json"
from { yes: 1, no: null}
write_json strip_null_fields=true
{
"yes": 1
}

read_json, parse_json, print_json