Skip to content

compress

Compresses a stream of bytes.

compress codec:string, [level=int]

Deprecated

The compress operator is deprecated. You should use the bespoke operators instead. These operators offer more options for some of the formats.

The compress operator compresses bytes in a pipeline incrementally with a known codec.

An identifier of the codec to use. Currently supported are brotli, bz2, gzip, lz4, and zstd.

The compression level to use. The supported values depend on the codec used. If omitted, the default level for the codec is used.

Export all events in a Gzip-compressed NDJSON file

Section titled “Export all events in a Gzip-compressed NDJSON file”
export
write_ndjson
compress "gzip"
save_file "/tmp/backup.json.gz"

Recompress a Zstd-compressed file at a higher compression level

Section titled “Recompress a Zstd-compressed file at a higher compression level”
load_file "in.zst"
decompress "zstd"
compress "zstd", level=18
save_file "out.zst"

Last updated: