base/protocols/redis/spicy-events.zeek

Redis

Events and records generated by the Redis analyzer.

Namespace:

Redis

Summary

Types

Redis::AuthCommand: record

The Redis AUTH command.

Redis::Command: record

A generic Redis command from the client.

Redis::HelloCommand: record

The Redis HELLO command (handshake).

Redis::ReplyData: record

A generic Redis reply from the client.

Redis::SetCommand: record

The Redis SET command.

Events

Redis::auth_command: event

Generated for Redis AUTH commands sent to the Redis server.

Redis::command: event

Generated for every command sent by the client to the Redis server.

Redis::error: event

Generated for every error response sent by the Redis server to the client.

Redis::get_command: event

Generated for Redis GET commands sent to the Redis server.

Redis::hello_command: event

Generated for Redis HELLO commands sent to the Redis server.

Redis::reply: event

Generated for every successful response sent by the Redis server to the client.

Redis::server_push: event

Generated for out-of-band data, outside of the request-response model.

Redis::set_command: event

Generated for Redis SET commands sent to the Redis server.

Detailed Interface

Types

Redis::AuthCommand
Type:

record

Fields:
username: string &optional

The username getting authenticated.

password: string

The password authenticated with.

The Redis AUTH command.

Redis::Command
Type:

record

Fields:
raw: vector of string

The raw command, exactly as parsed

name: string &log

The first element of the command. Some commands are two strings, meaning this is inaccurate for those cases.

key: string &log &optional

The key, if this command is known to have a key

value: string &log &optional

The value, if this command is known to have a value

known: Redis::RedisCommand &optional

The command in an enum if it was known

A generic Redis command from the client.

Redis::HelloCommand
Type:

record

Fields:
requested_resp_version: string &optional

The sent requested RESP version, such as “2” or “3”

The Redis HELLO command (handshake).

Redis::ReplyData
Type:

record

Fields:
attributes: string &optional

The RESP3 attributes applied to this, if any

value: string &log

The string version of the reply data

min_protocol_version: count

The minimum RESP version that supports this reply type

A generic Redis reply from the client.

Redis::SetCommand
Type:

record

Fields:
key: string &log

The key the SET command is setting.

value: string &log

The value the SET command is setting key to.

nx: bool

If NX is set – only set the key if it does not exist.

xx: bool

If XX is set – only set the key if it already exists.

get: bool

If GET is set – return the old string stored at key.

ex: count &optional

EX option – set the specified expire time, in seconds.

px: count &optional

PX option – set the specified expire time, in milliseconds.

exat: count &optional

EXAT option– set the specified Unix time at which the key will expire, in seconds.

pxat: count &optional

PXAT option – set the specified Unix time at which the key will expire, in milliseconds.

keep_ttl: bool

If KEEPTTL is set – retain the time to live associated with the key.

The Redis SET command.

Events

Redis::auth_command
Type:

event (c: connection, command: Redis::AuthCommand)

Generated for Redis AUTH commands sent to the Redis server.

Parameters:
  • c – The connection.

  • command – The AUTH command sent to the server and its data.

Redis::command
Type:

event (c: connection, cmd: Redis::Command)

Generated for every command sent by the client to the Redis server.

Parameters:
  • c – The connection.

  • cmd – The command sent to the server.

Redis::error
Type:

event (c: connection, data: Redis::ReplyData)

Generated for every error response sent by the Redis server to the client.

Parameters:
  • c – The connection.

  • data – The server data sent to the client.

Redis::get_command
Type:

event (c: connection, key: string)

Generated for Redis GET commands sent to the Redis server.

Parameters:
  • c – The connection.

  • command – The GET command sent to the server and its data.

Redis::hello_command
Type:

event (c: connection, command: Redis::HelloCommand)

Generated for Redis HELLO commands sent to the Redis server.

Parameters:
  • c – The connection.

  • command – The HELLO command sent to the server and its data.

Redis::reply
Type:

event (c: connection, data: Redis::ReplyData)

Generated for every successful response sent by the Redis server to the client. For RESP2, this includes “push” messages, which are out of band. These will also raise a server_push event. RESP3 push messages will only raise a server_push event.

Parameters:
  • c – The connection.

  • data – The server data sent to the client.

See also: Redis::server_push

Redis::server_push
Type:

event (c: connection, data: Redis::ReplyData)

Generated for out-of-band data, outside of the request-response model.

Parameters:
  • c – The connection.

  • data – The server data sent to the client.

Redis::set_command
Type:

event (c: connection, command: Redis::SetCommand)

Generated for Redis SET commands sent to the Redis server.

Parameters:
  • c – The connection.

  • command – The SET command sent to the server and its data.