Skip to main content
Version: Next

Redis

The Redis output writes messages to Redis using one of four data-structure operations: Pub/Sub publish, List push, Hash set, or String set. It supports single-node and cluster connections.

Configuration

FieldTypeRequiredDefaultDescription
typestringyesFixed value "redis"
modeobjectyesConnection mode (see below).
redis_typeobjectyesRedis operation to perform (see below).
value_fieldstringnoRecord field used as the message payload.

mode

mode is a tagged object (selected by its type field).

FieldTypeRequiredDefaultDescription
typestringyessingle or cluster.
urlstringyes (single)Redis server URL (e.g. redis://localhost:6379).
urlsarray<string>yes (cluster)Redis cluster node URLs.

redis_type

redis_type is a tagged object (selected by its type field). All keys/fields/channels are Expr<String> (see Expression objects).

publish

FieldTypeRequiredDescription
typestringyespublish.
channelobjectyesPub/Sub channel to publish to (expression).

list

FieldTypeRequiredDescription
typestringyeslist.
keyobjectyesList key; values are appended with RPUSH (expression).

hashes

FieldTypeRequiredDescription
typestringyeshashes.
keyobjectyesHash key (expression).
fieldobjectyesHash field name (expression).

strings

FieldTypeRequiredDescription
typestringyesstrings.
keyobjectyesString key (expression).

Expression objects

channel, key, and field are Expr<String> objects:

FieldTypeRequiredDescription
typestringyesvalue (static) or expr (SQL expression).
valuestringyes (value)Static value.
exprstringyes (expr)SQL expression evaluated per message.

Examples

Publish to a channel

output:
type: "redis"
mode:
type: "single"
url: "redis://localhost:6379"
redis_type:
type: "publish"
channel:
type: "value"
value: "notifications"

Push to a List

output:
type: "redis"
mode:
type: "single"
url: "redis://localhost:6379"
redis_type:
type: "list"
key:
type: "value"
value: "events"

Set a Hash field

output:
type: "redis"
mode:
type: "single"
url: "redis://localhost:6379"
redis_type:
type: "hashes"
key:
type: "value"
value: "user:1"
field:
type: "value"
value: "status"

Set a String

output:
type: "redis"
mode:
type: "single"
url: "redis://localhost:6379"
redis_type:
type: "strings"
key:
type: "expr"
expr: "concat('key:', id)"

Cluster connection

output:
type: "redis"
mode:
type: "cluster"
urls:
- "redis://redis-1:6379"
- "redis://redis-2:6379"
- "redis://redis-3:6379"
redis_type:
type: "list"
key:
type: "value"
value: "logs"