- A keyspace event that will use the pubsub channel for the key, possibly containing other events for the same key
- A keyevent event that will use the pubsub channel for the event, possibly containing other events for the different keys
__keyspace@0__:keynamechannel with the values of the event names for the keyspace notifications__keyevent@0__:eventnamechannel with the values of the key names for the keyevent notifications
Enabling Notifications
By default, all keyspace and keyevent notifications are off. To enable it, you can use theCONFIG SET command, and set the notify-keyspace-events options to one of the
appropriate flags described below.
At least one of the
K or E flags must be present in the option value.
For example, you can use the following command to receive keyspace notifications
only for the hash commands:
- cURL
- redis-cli
Disabling Notifications
You can reuse theCONFIG SET command and set notify-keyspace-events option to empty string
to disable all keyspace and keyevent notifications.
- cURL
- redis-cli
Checking Notification Configuration
CONFIG GET command can be used the get the current value of the notify-keyspace-events option
to see the active keyspace and keyevent notifications configuration.
- cURL
- redis-cli