# MONITOR

> Stream every command the server runs to this connection, as it runs.

URL: https://docs.hotkv.com/commands/monitor/

```
MONITOR
```

- Group: Server
- HotKV Cloud: all plans
- On-Premise: no license needed

`MONITOR` turns the current connection into a live feed of the commands
other clients run. It is a debugging tool: use it to see what an application
actually sends. Every command shown costs the server extra work, so don't
leave a monitor attached to a busy production server.

Each line has the time (Unix seconds with microseconds), the database and
client address in brackets, then the command and its arguments, each quoted.
Quotes, backslashes and control characters are escaped, and other
non-printable bytes are shown as `\xHH`.

Some commands are never shown: `AUTH`, `HELLO`, `MONITOR` itself, and
administrative commands (those with the `admin` flag, such as
[CONFIG](https://docs.hotkv.com/commands/config/index.md), [CLIENT](https://docs.hotkv.com/commands/client/index.md) and
[ACL](https://docs.hotkv.com/commands/acl/index.md)). Passwords in the commands that are shown, such as
the `AUTH` and `AUTH2` options of [MIGRATE](https://docs.hotkv.com/commands/migrate/index.md), show as
`(redacted)`.

To stop monitoring, close the connection, or send [RESET](https://docs.hotkv.com/commands/reset/index.md).

## Return value

Simple string `OK`, then a stream of simple strings, one per command, in
RESP2 and RESP3.

## Examples

```
127.0.0.1:6379> MONITOR
OK
1790000000.123456 [0 10.0.0.21:40118] "SET" "session:42" "token" "EX" "3600"
1790000000.125901 [0 10.0.0.22:51522] "GET" "session:42"
1790000001.004210 [2 10.0.0.23:39410] "HSET" "user:7" "name" "Ada"
```

## Compatibility

Same output format as Redis 7 and Valkey 8. Commands run inside a Lua script
or function are not shown individually in HotKV; the
[EVAL](https://docs.hotkv.com/commands/eval/index.md) or [FCALL](https://docs.hotkv.com/commands/fcall/index.md) call itself is.

## See also

[SLOWLOG](https://docs.hotkv.com/commands/slowlog/index.md), [CLIENT LIST](https://docs.hotkv.com/commands/client-list/index.md),
[AUDIT.EXPORT](https://docs.hotkv.com/commands/audit-export/index.md)