COMMANDLOG-GET(3valkey)
π COMMANDLOG-GET π
okay bestie, so this page is from the Valkey Command Manual, and we're talking about commandlog-get β it literally just returns the entries from the command log you asked for. no cap. π
β¨ NAME β¨
commandlog-get β returns the specified command log's entries. periodt. π
π SYNOPSIS π
COMMANDLOG GET count <SLOW | LARGE-REQUEST | LARGE-REPLY>
π¦ DESCRIPTION π¦
So the COMMANDLOG GET command hands you back entries from the command log of the type you picked, in chronological order. oldest first, like a story. π
The Command Log system is out here recording commands that eat up significant resources while the server is doing its thing β that's CPU, memory, and network bandwidth. these commands and the data they touch can lowkey push an instance into weird behaviour, and the command log is there so you can quickly and intuitively locate the issue. it's giving detective. π
Right now, three types of command logs are supported:
- SLOW: logs commands that exceed a specified execution time. this one excludes time spent on I/O operations like client communication, and focuses solely on the command's processing time, where the main thread is blocked. so it's the pure command brain work. π§
- LARGE-REQUEST: logs commands with requests exceeding a defined size. this helps you spot potentially problematic commands that send excessive data to the server. π
- LARGE-REPLY: logs commands that generate replies exceeding a defined size. this helps you spot commands returning unusually large amounts of data, which may impact network performance or client processing. π
Each log type has two key parameters:
- A threshold value that determines when a command is logged. this threshold is specific to the type of log (e.g., execution time, request size, or reply size). a negative value disables logging. a value of
0logs all commands. π - A maximum length that specifies the number of entries to retain in the log. increasing the length allows more entries to be stored but consumes additional memory. to clear all entries for a specific log type and reclaim memory, use the
valkey-commandlog-reset(7)COMMANDLOG RESETsubcommand followed by the log type. π§Ή
See the details of configurations in valkey.conf. β¨
Each entry from the specific type of command log is comprised of the following six values:
- A unique progressive identifier for every entry.
- The unix timestamp at which the logged command was processed.
- Each type of command log has its own meaning, currently there are three types:
- time in microseconds for type of
slow - size in bytes for type of
large-request - size in bytes for type of
large-reply
- time in microseconds for type of
- The array composing the arguments of the command.
- Client peer information (e.g. Client IP address and port for TCP connected clients or unix path for unix sockets).
- Client name if set via the
valkey-client-setname(7)CLIENT SETNAMEcommand.
The entry's unique ID can be used in order to avoid processing command log entries multiple times (for instance you may have a script sending you an email alert for every new command log entry). the ID is never reset in the course of the Valkey server execution, even after valkey-commandlog-reset(7) COMMANDLOG RESET was executed. in order to reset the ID a server restart is needed. so yeah, that ID is committed for life. π
β COMPLEXITY β
O(N) where N is the number of entries returned
π₯ ACL CATEGORIES π₯
@admin @dangerous @slow
ngl, @dangerous is right there in the list, so maybe don't yolo it in prod without thinking. π
πΈ HISTORY πΈ
- Available since:
8.1.0
π SEE ALSO π
acl(3valkey), acl-cat(3valkey), acl-deluser(3valkey), acl-dryrun(3valkey), acl-genpass(3valkey), acl-getuser(3valkey), acl-help(3valkey), acl-list(3valkey), acl-load(3valkey), acl-log(3valkey), acl-save(3valkey), acl-setuser(3valkey), acl-users(3valkey), acl-whoami(3valkey), bgrewriteaof(3valkey), bgsave(3valkey), command(3valkey), command-count(3valkey), command-docs(3valkey), command-getkeys(3valkey), command-getkeysandflags(3valkey), command-help(3valkey), command-info(3valkey), command-list(3valkey), commandlog(3valkey), commandlog-help(3valkey), commandlog-len(3valkey), commandlog-reset(3valkey), config(3valkey), config-get(3valkey), config-help(3valkey), config-resetstat(3valkey), config-rewrite(3valkey), config-set(3valkey), dbsize(3valkey), debug(3valkey), failover(3valkey), flushall(3valkey), flushdb(3valkey), info(3valkey), lastsave(3valkey), latency(3valkey), latency-doctor(3valkey), latency-graph(3valkey), latency-help(3valkey), latency-histogram(3valkey), latency-history(3valkey), latency-latest(3valkey), latency-reset(3valkey), lolwut(3valkey), memory(3valkey), memory-doctor(3valkey), memory-help(3valkey), memory-malloc-stats(3valkey), memory-purge(3valkey), memory-stats(3valkey), memory-usage(3valkey), module(3valkey), module-help(3valkey), module-list(3valkey), module-load(3valkey), module-loadex(3valkey), module-unload(3valkey), monitor(3valkey), psync(3valkey), replconf(3valkey), replicaof(3valkey), restore-asking(3valkey), role(3valkey), save(3valkey), shutdown(3valkey), slowlog(3valkey), slowlog-get(3valkey), slowlog-help(3valkey), slowlog-len(3valkey), slowlog-reset(3valkey), swapdb(3valkey), sync(3valkey), time(3valkey)
okay that's the whole page, you ate it bestie π«Ά this one's from Valkey version 9.0.0, dated 2025-10-21, and it lives in the Valkey Command Manual. go forth and log responsibly π β¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms