redis_pubsub
Consume from a Redis publish/subscribe channel using either the SUBSCRIBE or PSUBSCRIBE commands.
- Common
- Advanced
# Common config fields, showing default values
input:
label: ""
redis_pubsub:
url: redis://:6397 # No default (required)
channels: [] # No default (required)
use_patterns: false
auto_replay_nacks: true
# All config fields, showing default values
input:
label: ""
redis_pubsub:
url: redis://:6397 # No default (required)
kind: simple
master: ""
tls:
enabled: false
skip_cert_verify: false
enable_renegotiation: false
root_cas: ""
root_cas_file: ""
client_certs: []
channels: [] # No default (required)
use_patterns: false
auto_replay_nacks: true
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?llosubscribes to hello, hallo and hxlloh*llosubscribes to hllo and heeeelloh[ae]llosubscribes to hello and hallo, but not hillo
Use \ to escape special characters if you want to match them verbatim.
Fields
url
The URL of the target Redis server. Database is optional and is supplied as the URL path.
Type: string
# Examples
url: redis://:6397
url: redis://localhost:6379
url: redis://foousername:foopassword@redisplace:6379
url: redis://:foopassword@redisplace:6379
url: redis://localhost:6379/1
url: redis://localhost:6379/1,redis://localhost:6380/1
kind
Specifies a simple, cluster-aware, or failover-aware redis client.
Type: string
Default: "simple"
Options: simple, cluster, failover.
master
Name of the redis master when kind is failover
Type: string
Default: ""
# Examples
master: mymaster
tls
Custom TLS settings can be used to override system defaults.
Troubleshooting
Some cloud hosted instances of Redis (such as Azure Cache) might need some hand holding in order to establish stable connections. Unfortunately, it is often the case that TLS issues will manifest as generic error messages such as "i/o timeout". If you're using TLS and are seeing connectivity problems consider setting enable_renegotiation to true, and ensuring that the server supports at least TLS version 1.2.
Type: object
tls.enabled
Whether custom TLS settings are enabled.
Type: bool
Default: false
tls.skip_cert_verify
Whether to skip server side certificate verification.
Type: bool
Default: false
tls.enable_renegotiation
Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message local error: tls: no renegotiation.
Type: bool
Default: false
Requires version 1.0.0 or newer