Return to
Portfolio

111.1. Batched Compression (om_batchcompress)

This module uses its own protocol to send batches of log messages to a remote NXLog instance configured with the im_batchcompress module. The messages are compressed in batches in order to achieve better compression ratios than would be possible individually. The module serializes and sends all fields across the network so that structured data is preserved. It can be configured to send data using SSL for secure and encrypted data transfer. The protocol contains an acknowledgment in order to ensure that the data is received by the remote server. The batch will be resent if the server does not respond with an acknowledgment.

111.1.1. Configuration

The om_batchcompress module accepts the following directives in addition to the common module directives. The Host directive is required.

Host

This specifies the IP address or a DNS hostname the module should connect to.

Port

The module will connect to this port number on the remote host. The default port is 2514.


AllowUntrusted

This boolean directive specifies that the remote connection should be allowed without certificate verification. If set to TRUE the remote will be able to connect with unknown and self-signed certificates. The default value is FALSE: all connections must present a trusted certificate.

CADir

This specifies the path to a directory containing certificate authority (CA) certificates, which will be used to check the certificate of the remote socket. The certificate filenames in this directory must be in the OpenSSL hashed format. A remote’s self-signed certificate (which is not signed by a CA) can also be trusted by including a copy of the certificate in this directory.

CAFile

This specifies the path of the certificate authority (CA) certificate, which will be used to check the certificate of the remote socket. To trust a self-signed certificate presented by the remote (which is not signed by a CA), provide that certificate instead.

CertFile

This specifies the path of the certificate file to be used for the SSL handshake.

CertKeyFile

This specifies the path of the certificate key file to be used for the SSL handshake.

CRLDir

This specifies the path to a directory containing certificate revocation lists (CRLs), which will be consulted when checking the certificate of the remote socket. The certificate filenames in this directory must be in the OpenSSL hashed format.

CRLFile

This specifies the path of the certificate revocation list (CRL) which will be consulted when checking the certificate of the remote socket.

FlushInterval

The module will send a batch of data to the remote after this amount of time in seconds, unless FlushLimit is reached first. This defaults to 5 seconds.

FlushLimit

When the number of events in the output buffer reaches the value specified by this directive, the module will compress and send the batch to the remote. This defaults to 500 events. The FlushInterval directive may trigger sending the batch before this limit is reached if the log volume is low to ensure that data is sent promptly.

KeyPass

With this directive, a password can be supplied for the certificate key file defined in CertKeyFile. This directive is not needed for passwordless private keys.

LocalPort

This optional directive specifies the local port number of the connection. If this is not specified a random high port number will be used, which is not always ideal in firewalled network environments.

SSLCipher

This optional directive can be used to set the permitted SSL cipher list, overriding the default. Use the format described in the ciphers(1ssl) man page.

SSLProtocol

This directive can be used to set the allowed SSL/TLS protocol(s). It takes a comma-separated list of values which can be any of the following: SSLv2, SSLv3, TLSv1, TLSv1.1, and TLSv1.2. By default, the TLSv1, TLSv1.2, and TLSv1.2 protocols are allowed. Note that the OpenSSL library shipped by Linux distributions may not support SSLv2 and SSLv3, in which case these will not work even if enabled with SSLProtocol.

UseSSL

This boolean directive specifies that SSL transfer mode should be enabled. The default is FALSE.

111.1.2. Examples

Example 594. Sending Logs With om_batchcompress

This configuration forwards logs in compressed batches to a remote NXLog agent over the default port. Batches are sent at least once every two seconds, or more frequently if the buffer reaches 100 events.

nxlog.conf [Download file]
1
2
3
4
5
6
7
<Output batchcompress>
    Module          om_batchcompress
    Host            10.0.0.1
    Port            2514
    FlushLimit      100
    FlushInterval   2
</Output>