Redis Client

Download 1
Last updated Nov 18, 2026

redis-set-batch

Set the value of the value field to the key of the key field in a Redis connect profile for each input row.

Syntax

redis-set-batch profile=STRING key=STRING value=STRING [ex=INT] [keep-ttl=BOOL]

Options

profile=STRING
Required. Name of the Redis connect profile. Either a Redis Client (Standalone) or a Redis Client (Sentinel) profile is accepted. Example: profile=my_redis
key=STRING
Required. Name of the input field holding the Redis key. Example: key=user_id
value=STRING
Required. Name of the input field holding the value to SET. Example: value=name
ex=INT
Optional. Expiration time in seconds. An integer of 1 or more. Cannot be used with keep-ttl.
keep-ttl=BOOL
Optional. Retain the existing TTL of the key. Specify t. Requires Redis 6.0 or later. Cannot be used with ex.

Input fields

FieldTypeRequiredDescription
Field named by the key optionStringYRedis key
Field named by the value optionStringYValue to store. Converted to a string

Output fields

FieldTypeNameDescription
_errorStringErrorError message for SET failure of the row. Absent on success

All fields of the input row are passed through unchanged; the _error field is added only to rows that failed.

Error codes

Parse errors

Error messageCauseResolution
No available Redis profileNo profile with the given name exists, or the current account is not granted access to it.Check the profile name and grant the account access to the profile.
profile option is requiredThe profile option is missing or empty.Specify profile=profile_name.
key option is requiredThe key option is missing or empty.Specify key=field_name.
value option is requiredThe value option is missing or empty.Specify value=field_name.
ex option must be a positive integerThe ex value is not an integer or is 0 or less.Specify an integer of 1 or more.
ex and keep-ttl cannot be used togetherBoth options were specified.Specify only one of them.

Runtime errors

Error messageCauseResolution
(_error field of the output row)A Redis error occurred while processing the row, such as a connection failure, authentication failure, timeout or WRONGTYPE. The query does not abort; the _error field is added to the row. If the connection fails, every row gets the same error.Check the message in the _error field, the connection settings and the key type.
missing field_name(key) fieldThe field named by the key option does not exist in the input row.Check that the input row has the field.
missing field_name(value) fieldThe field named by the value option does not exist in the input row.Check that the input row has the field.

Description

For each incoming row, the value of the key field is used as the key and the value of the value field is converted to a string and stored with the Redis SET command. The connection is opened once when the query starts and reused for all rows. Existing values are overwritten.

With ex, the expiration is set with SET EX; with keep-ttl=t, the existing TTL is retained. With neither, the value is stored without expiration and any existing TTL is removed. If a row fails, the query continues and _error is recorded on that row.

Note
The keep-ttl option works only on Redis 6.0 or later.

Examples

Example: Caching user names

Situation: Store the name of each user ID in Redis for one hour.

json "{}"
| eval user_id="user01", name="Alice"
| redis-set-batch profile=my_redis key=user_id value=name ex=3600

Expected result:

user_idname
user01Alice

Interpretation: A row without the _error field was stored successfully.