CLIENT INFO to get a line of statistics about the connection issuing the command.
The reply is a single line of space-separated field=value pairs describing the connection: its id, name, address, age, idle time, the number of commands it has run, and the last command it executed. It reports the same fields as one line of CLIENT LIST, limited to your own connection, which makes it a cheap way to confirm what the server thinks of the connection you are on. Parse it defensively, since fields can be added over time.
Syntax
Arguments
This command takes no arguments.Important points
- This is a connection-oriented command and is available over native Redis TCP, not the stateless REST endpoint.
- This command can expose administrative information or make a broad destructive change. Restrict it to trusted code paths.
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs