RSyslog Documentation

Imhiredis: Redis input plugin

Module Name:imhiredis
Author:Jeremie Jourdin <>


Imhiredis is an input module reading arbitrary entries from Redis. It uses the hiredis library to query Redis instances using 2 modes:

Queue mode

The queue mode uses Redis LISTs to push/pop messages to/from lists. It allows simple and efficient uses of Redis as a queueing system, providing both LIFO and FIFO methods.

This mode should be preferred if the user wants to use Redis as a caching system, with one (or many) Rsyslog instances POP’ing out entries.


This mode was configured to provide optimal performances while not straining Redis, but as imhiredis has to poll the instance some trade-offs had to be made:

  • imhiredis POPs entries by batches of 10 to improve performances (this is currently not configurable)
  • when no entries are left in the list, the module sleeps for 1 second before checking the list again. This means messages might be delayed by as much as 1 second between a push to the list and a pop by imhiredis (entries will still be POP’ed out as fast as possible while the list is not empty)

Channel mode

The subscribe mode uses Redis PUB/SUB system to listen to messages published to Redis’ channels. It allows performant use of Redis as a message broker.

This mode should be preferred to use Redis as a message broker, with zero, one or many subscribers listening to new messages.


This mode shouldn’t be used if messages are to be reliably processed, as messages published when no Imhiredis is listening will result in the loss of the message.


This module is able to automatically connect to the master instance of a master/replica(s) cluster. Simply providing a valid connection entry point (being the current master or a valid replica), Imhiredis is able to redirect to the master node on startup and when states change between nodes.

Configuration Parameters


Parameter names are case-insensitive

Input Parameters


typedefaultmandatoryobsolete legacy directive

Defines the mode to use for the module. Should be either “subscribe” (Channel mode), or “queue” (Queue mode) (case-sensitive).


typedefaultmandatoryobsolete legacy directive

Defines either the name of the list to use (for Queue mode) or the channel to listen to (for Channel mode).


typedefaultmandatoryobsolete legacy directive
wordnoif no server providednone

Defines the socket to use when trying to connect to Redis. Will be ignored if both server and socketPath are given.


typedefaultmandatoryobsolete legacy directive
ip127.0.0.1if no socketPath providednone

The Redis server’s IP to connect to.


typedefaultmandatoryobsolete legacy directive

The Redis server’s port to use when connecting via IP.


typedefaultmandatoryobsolete legacy directive

The password to use when connecting to a Redis node, if necessary.


typedefaultmandatoryobsolete legacy directive

When using the Queue mode, defines if imhiredis should use a LPOP instruction instead of a RPOP (the default). Has no influence on the Channel mode and will be ignored if set with this mode.


typedefaultmandatoryobsolete legacy directive
Assign messages from this input to a specific Rsyslog ruleset.   

See also

Help with configuring/using Rsyslog:

  • Mailing list - best route for general questions
  • GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with Rsyslog
  • Stack Exchange (View, Ask) - experimental support from rsyslog community

See also

Contributing to Rsyslog:

Copyright 2008-2020 Rainer Gerhards (Großrinderfeld), and Others.

Scroll to top