Return to
Portfolio

111.16. Redis (om_redis)

This module can store data in a Redis server. It issues RPUSH commands using the Redis Protocol to send data.

The input counterpart, im_redis, can be used to retrieve data from a Redis server.

111.16.1. Configuration

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

Host

This mandatory directive specifies the IP address or DNS hostname of the Redis server to connect to.


Channel

This directive is interpreted the same way as the Key directive (can be an expression which evaluates to a string), except that its evaluated value will be used as the name of the Redis channel to which this module will publish records. The usage of this directive is mutually exclusive with the usage of the LPUSH, RPUSH LPUSHX and RPUSHX commands in the Command directive.

Command

This optional directive specifies the command to be used. The possible commands are LPUSH, RPUSH (the default), LPUSHX, RPUSHX and PUBLISH.

Key

This specifies the Key used by the RPUSH command. It must be a string type expression. If the expression in the Key directive is not a constant string (it contains functions, field names, or operators), it will be evaluated for each event to be inserted. The default is nxlog. The usage of this directive is mutually exclusive with the usage of the PUBLISH command in the Command directive.

OutputType

See the OutputType directive in the list of common module directives. If this directive is unset, the default Dgram formatter function is used, which writes the value of $raw_event without a line terminator. To preserve structured data Binary can be used, but it must also be set on the other end.

Port

This specifies the port number of the Redis server. The default is port 6379.