Module Name: omhiredis
Original Author: Brian Knox <bknox@digitalocean.com>
Description
This module provides native support for writing to Redis, using the hiredis client library.
Action Parameters
Examples
Mode: template
In “template” mode, the string constructed by the template is sent to Redis as a command. Note this mode has problems with strings with spaces in them - full message won’t work correctly. In this mode, the template argument is required, and the key argument is meaningless.
module(load=”omhiredis”)
Here’s an example redis-cli session where we HGETALL the counts:
Mode: queue
In “queue” mode, the syslog message is pushed into a Redis list at “key”, using the LPUSH command. If a template is not supplied, the plugin will default to the RSYSLOG_ForwardFormat template.
module(load=”omhiredis”)
Here’s an example redis-cli session where we RPOP from the queue:
> redis-cli 127.0.0.1:6379> RPOP my_queue
“<46>2015-09-17T10:54:50.080252-04:00 myhost rsyslogd: [origin software=”rsyslogd” swVersion=”8.13.0.master” x-pid=”6452” x-info=”http://www.rsyslog.com“] start”
127.0.0.1:6379>
Mode: publish
In “publish” mode, the syslog message is published to a Redis topic set by “key”. If a template is not supplied, the plugin will default to the RSYSLOG_ForwardFormat template.
module(load=”omhiredis”)
Here’s an example redis-cli session where we SUBSCRIBE to the topic:
> redis-cli
127.0.0.1:6379> subscribe my_channel
Reading messages... (press Ctrl-C to quit)
This documentation is part of the rsyslog project.
Copyright © 2008-2015 by Rainer Gerhards and Adiscon. Released under the GNU GPL version 3 or higher.