Skip to main content
Version: 2.1.2

Redis

Description

Read data from Redis.

tip

Engine Supported and plugin name

  • Spark: Redis
  • Flink

Options

nametyperequireddefault value
hoststringno"localhost"
portintno6379
authstringno
db_numintno0
keys_or_key_patternstringyes
partition_numintno3
data_typestringno"KV"
timeoutintno2000
common-optionsstringyes

host [string]

Redis server address, default "localhost"

port [int]

Redis service port, default 6379

auth [string]

Redis authentication password

db_num [int]

Redis database index ID. It is connected to db 0 by default

keys_or_key_pattern [string]

Redis Key, support fuzzy matching

partition_num [int]

Number of Redis shards. The default is 3

data_type [string]

Redis data type eg: KV HASH LIST SET ZSET

timeout [int]

Redis timeout

common options [string]

Source Plugin common parameters, refer to Source Plugin for details

Example

redis {
host = "localhost"
port = 6379
auth = "myPassword"
db_num = 1
keys_or_key_pattern = "*"
partition_num = 20
data_type = "HASH"
result_table_name = "hash_result_table"
}

The returned table is a data table in which both fields are strings

raw_keyraw_message
keysxxx
my_keysxxx
keys_minexxx