.. _param-imptcp-compression-mode:
.. _imptcp.parameter.input.compression-mode:

Compression.mode
================

.. index::
   single: imptcp; Compression.mode
   single: Compression.mode

.. summary-start

Selects decompression mode matching compression used by omfwd.

.. summary-end

This parameter applies to :doc:`../../configuration/modules/imptcp`.

:Name: Compression.mode
:Scope: input
:Type: word
:Default: input=none
:Required?: no
:Introduced: at least 5.x, possibly earlier

Description
-----------
This is the counterpart to the compression modes set in
:doc:`omfwd <../../configuration/modules/omfwd>`.
``imptcp`` accepts the following values:

- ``none`` - do not attempt stream decompression.
- ``stream:always`` - treat the full TCP byte stream as a zlib-compressed
  stream generated by :doc:`omfwd <../../configuration/modules/omfwd>` with
  ``compression.mode="stream:always"``.

This receive path is a fixed-policy implementation:

- it uses streaming zlib decompression during normal receives,
- it performs a final decompression drain when the TCP session closes,
- it is compatible with sender-side
  ``compression.stream.flushOnTXEnd="on"`` and ``"off"``,
- it logs malformed or truncated compressed streams and closes the session.

``imptcp`` does not support the sender-side ``single`` compression mode here.

Input usage
-----------
.. _param-imptcp-input-compression-mode:
.. _imptcp.parameter.input.compression-mode-usage:

.. code-block:: rsyslog

   input(type="imptcp" compression.mode="stream:always")

See also
--------
See also :doc:`../../configuration/modules/imptcp`.
