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.
Description
Section titled “Description”The compress
operator compresses bytes in a pipeline incrementally with a
known codec.
codec: string
Section titled “codec: string”An identifier of the codec to use. Currently supported are brotli
, bz2
,
gzip
, lz4
, and zstd
.
level = int (optional)
Section titled “level = int (optional)”The compression level to use. The supported values depend on the codec used. If omitted, the default level for the codec is used.
Examples
Section titled “Examples”Export all events in a Gzip-compressed NDJSON file
Section titled “Export all events in a Gzip-compressed NDJSON file”exportwrite_ndjsoncompress "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=18save_file "out.zst"