Redis Client

Download 1
Last updated Nov 18, 2026

redis-lpush-batch

Push the value of the value field to the head of the Redis list of the key field for each input row.

Syntax

redis-lpush-batch profile=STRING key=STRING value=STRING

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 list key. Example: key=queue
value=STRING
Required. Name of the input field holding the value to LPUSH. Example: value=job

Input fields

FieldTypeRequiredDescription
Field named by the key optionStringYRedis list key
Field named by the value optionStringYValue to push

Output fields

FieldTypeNameDescription
lengthIntegerLengthLength of the list after the push
_errorStringErrorError message for LPUSH failure of the row. Absent on success

All fields of the input row are passed through unchanged, and the length or _error field is added.

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.

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 value field is converted to a string and pushed to the head of the Redis list named by the key field, and the list length after the push is added as the length field. The connection is opened once when the query starts and reused for all rows.

If the list key does not exist, it is created. For a key of a non-list type, a WRONGTYPE error is recorded in _error of that row and the query continues. Values are stacked at the head in row order, so the latest value ends up first in the list.

Examples

Example: Registering a job in a queue

Situation: Register a job ID in the queue queue:jobs and check the queue length.

json "{}"
| eval queue="queue:jobs", job="job-1003"
| redis-lpush-batch profile=my_redis key=queue value=job

Expected result:

queuejoblength
queue:jobsjob-10031

Interpretation: length is the number of elements in the list right after the push.