SLOWLOG-GET(3valkey)
π NAME π
okay so bestie, this is slowlog-get β and it returns the slow log's entries. that's the whole vibe. it's the Valkey Command Manual entry for SLOWLOG-GET(3valkey), and yes it's giving very "let me show u receipts" energy. π§Ύβ¨
πΈ SYNOPSIS πΈ
SLOWLOG GET [count]
that's it. that's the whole thing. iconic. π
β¨ DESCRIPTION β¨
okay so SLOWLOG GET hands you back entries from the slow log, and it does it in chronological order β like, oldest first, in the order they actually happened. no shuffling, no chaos. π°οΈ
now let's talk about what the Valkey Slow Log even is. it's a whole system for logging queries that went over a specified execution time. and here's the part ppl always get wrong: that execution time does not include I/O operations β not talking with the client, not sending the reply, none of that. it's just the time needed to actually execute the command. which makes sense actually, because that's the only stage of command execution where the thread is blocked and can't serve other requests in the meantime. so yeah, that's the number that actually matters. π«Ά
a new entry gets added to the slow log whenever a command exceeds the execution time threshold defined by the slowlog-log-slower-than configuration directive. and the maximum number of entries the slow log can hold? that's governed by the slowlog-max-len configuration directive. two configs, two jobs, both slaying. π
by default the command returns the latest ten entries in the log. the optional count argument limits how many come back, so the command returns at most up to count entries. and the special number -1 means return all entries. (yes, -1 is the "give me everything, idc" option. we love her.) π
each entry from the slow log is made up of these six values:
- a unique progressive identifier for every slow log entry.
- the unix timestamp at which the logged command was processed.
- the amount of time needed for its execution, in microseconds.
- the array composing the arguments of the command.
- client IP address and port.
- client name if set via the
CLIENT SETNAMEcommand.
and the entry's unique ID? it exists so you can avoid processing slow log entries multiple times β like, say you've got a script emailing you an alert for every new slow log entry. that ID is your bestie fr fr. π₯Ή important: the ID is never reset in the course of the Valkey server execution. only a server restart will reset it.
π¦ Alternative π¦
COMMANDLOG GET <count> SLOW
(that's the other way to get the same energy, iykyk.)
π REPLY π
valkey-protocol(7) Array reply: a list of slow log entries per the above format. π«
π₯ COMPLEXITY π₯
O(N) where N is the number of entries returned. not me stressing over the letters, it's fine, it's linear. π«
π ACL CATEGORIES π
@admin @dangerous @slow
heads up bestie: @dangerous is right there in the list. this one is not a casual little command. treat it accordingly. π
π HISTORY π
- Available since:
2.2.12 - Changed in
4.0.0: Added client IP address, port and name to the reply.
π SEE ALSO π
the whole extended family showed up, and we're listing every single one because nobody gets left out:
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-get(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-help(3valkey)slowlog-len(3valkey)slowlog-reset(3valkey)swapdb(3valkey)sync(3valkey)time(3valkey)
and that's the whole page, bestie!! πβ¨ this was version 9.0.0, dated 2025-10-21, straight from the Valkey Command Manual for SLOWLOG-GET(3valkey). go log something slow and slay. π¦π
π¦ 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