redis_pubsub

Consume from a Redis publish/subscribe channel using either the SUBSCRIBE or PSUBSCRIBE commands.

# Config fields, showing default values
input:
redis_pubsub:
url: tcp://localhost:6379
channels:
- benthos_chan
use_patterns: false

In order to subscribe to channels using the PSUBSCRIBE command set the field use_patterns to true, then you can include glob-style patterns in your channel names. For example:

  • h?llo subscribes to hello, hallo and hxllo
  • h*llo subscribes to hllo and heeeello
  • h[ae]llo subscribes to hello and hallo, but not hillo

Use \ to escape special characters if you want to match them verbatim.

Fields

url

The URL of a Redis server to connect to.

Type: string
Default: "tcp://localhost:6379"

# Examples
url: tcp://localhost:6379

channels

A list of channels to consume from.

Type: array
Default: ["benthos_chan"]

use_patterns

Whether to use the PSUBSCRIBE command.

Type: bool
Default: false