<!doctypehtml><meta charset=utf-8><title>
   CLIENT LIST – Redis
  </title><link href=/styles.css rel=stylesheet><link rel="shortcut icon"href=/images/favicon.png><link title="Look up a Redis command"href=/opensearch.xml rel=search type=application/opensearchdescription+xml><meta content=width=device-width,minimum-scale=1.0,maximum-scale=1.0 name=viewport><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
      new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
      j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
      'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
      })(window,document,'script','dataLayer','GTM-T4MTBKP');</script><body><noscript><iframe height=0 src=https://www.googletagmanager.com/ns.html?id=GTM-T4MTBKP style=display:none;visibility:hidden width=0></iframe></noscript><div class="mobile-menu slideout-menu"><header class=menu-header></header><section class=menu-section><ul class=menu-section-list><li><a class=home href=/> Home </a><li><a href=/commands> Commands </a><li><a href=/clients> Clients </a><li><a href=/documentation> Documentation </a><li><a href=/community> Community </a><li><a href=/download> Download </a><li><a href=/modules> Modules </a><li><a href=/support> Support </a></ul></section></div><div class=site-wrapper><header class=site-header><nav class=container><div class=mobile-header><button class="btn-hamburger js-slideout-toggle"><span class="fa fa-bars"> </span></button><a class=home href=/> <img alt=Redis src=/images/redis-white.png> </a><a class=tryfree href=https://redis.com/try-free> Try Free </a></div><div class=desktop-header><a class=home href=/> <img alt=Redis src=/images/redis-white.png> </a><a href=/commands> Commands </a><a href=/clients> Clients </a><a href=/documentation> Documentation </a><a href=/community> Community </a><a href=/download> Download </a><a href=/modules> Modules </a><a href=/support> Support </a><a class=tryfree href=https://redis.com/try-free> Try Free </a></div></nav></header><div class=site-content><div class=text><h1 class=command><span class=name> CLIENT LIST </span> <span class=arg> [TYPE normal|master|replica|pubsub] </span> <span class=arg> [ID client-id [client-id ...]] </span></h1><article><div class=article-main><div class=metadata><p><strong> Available since 2.4.0. </strong><p><strong> Time complexity: </strong> O(N) where N is the number of client connections</div><p>The <a href=/commands/client-list> CLIENT LIST </a> command returns information and statistics about the client connections server in a mostly human readable format.<p>You can use one of the optional subcommands to filter the list. The <code>
         TYPE type
        </code> subcommand filters the list by clients' type, where <em> type </em> is one of <code>
         normal
        </code> , <code>
         master
        </code> , <code>
         replica
        </code> , and <code>
         pubsub
        </code> . Note that clients blocked by the <a href=/commands/monitor> MONITOR </a> command belong to the <code>
         normal
        </code> class.<p>The <code>
         ID
        </code> filter only returns entries for clients with IDs matching the <code>
         client-id
        </code> arguments.</p><span class=anchor id=return-value> </span><h2><a class=anchor-link href=#return-value> * </a> Return value</h2><p><a href=/topics/protocol#bulk-string-reply> Bulk string reply </a> : a unique string, formatted as follows:<ul><li>One client connection per line (separated by LF)<li>Each line is composed of a succession of <code>
          property=value
         </code> fields separated by a space character.</ul><p>Here is the meaning of the fields:<ul><li><code>
          id
         </code> : an unique 64-bit client ID.<li><code>
          name
         </code> : the name set by the client with <a href=/commands/client-setname> CLIENT SETNAME </a><li><code>
          addr
         </code> : address/port of the client<li><code>
          laddr
         </code> : address/port of local address client connected to (bind address)<li><code>
          fd
         </code> : file descriptor corresponding to the socket<li><code>
          age
         </code> : total duration of the connection in seconds<li><code>
          idle
         </code> : idle time of the connection in seconds<li><code>
          flags
         </code> : client flags (see below)<li><code>
          db
         </code> : current database ID<li><code>
          sub
         </code> : number of channel subscriptions<li><code>
          psub
         </code> : number of pattern matching subscriptions<li><code>
          multi
         </code> : number of commands in a MULTI/EXEC context<li><code>
          qbuf
         </code> : query buffer length (0 means no query pending)<li><code>
          qbuf-free
         </code> : free space of the query buffer (0 means the buffer is full)<li><code>
          obl
         </code> : output buffer length<li><code>
          oll
         </code> : output list length (replies are queued in this list when the buffer is full)<li><code>
          omem
         </code> : output buffer memory usage<li><code>
          events
         </code> : file descriptor events (see below)<li><code>
          cmd
         </code> : last command played<li><code>
          argv-mem
         </code> : incomplete arguments for the next command (already extracted from query buffer)<li><code>
          tot-mem
         </code> : total memory consumed by this client in its various buffers<li><code>
          redir
         </code> : client id of current client tracking redirection<li><code>
          user
         </code> : the authenticated username of the client</ul><p>The client flags can be a combination of:<pre><code>A: connection to be closed ASAP
b: the client is waiting in a blocking operation
c: connection to be closed after writing entire reply
d: a watched keys has been modified - EXEC will fail
i: the client is waiting for a VM I/O (deprecated)
M: the client is a master
N: no specific flag set
O: the client is a client in MONITOR mode
P: the client is a Pub/Sub subscriber
r: the client is in readonly mode against a cluster node
S: the client is a replica node connection to this instance
u: the client is unblocked
U: the client is connected via a Unix domain socket
x: the client is in a MULTI/EXEC context
t: the client enabled keys tracking in order to perform client side caching
R: the client tracking target client is invalid
B: the client enabled broadcast tracking mode 
</code></pre><p>The file descriptor events can be:<pre><code>r: the client socket is readable (event loop)
w: the client socket is writable (event loop)
</code></pre><span class=anchor id=notes> </span><h2><a class=anchor-link href=#notes> * </a> Notes</h2><p>New fields are regularly added for debugging purpose. Some could be removed in the future. A version safe Redis client using this command should parse the output accordingly (i.e. handling gracefully missing fields, skipping unknown fields).</p><span class=anchor id=history> </span><h2><a class=anchor-link href=#history> * </a> History</h2><ul><li><code>
          >= 2.8.12
         </code> : Added unique client <code>
          id
         </code> field.<li><code>
          >= 5.0
         </code> : Added optional <a href=/commands/type> TYPE </a> filter.<li><code>
          >= 6.2
         </code> : Added <code>
          laddr
         </code> field and the optional <code>
          ID
         </code> filter.</ul></div><div class=article-aside><aside><h2>Related commands</h2><ul><li><a href=/commands/auth> AUTH </a><li><a href=/commands/client-caching> CLIENT CACHING </a><li><a href=/commands/client-getname> CLIENT GETNAME </a><li><a href=/commands/client-getredir> CLIENT GETREDIR </a><li><a href=/commands/client-id> CLIENT ID </a><li><a href=/commands/client-info> CLIENT INFO </a><li><a href=/commands/client-kill> CLIENT KILL </a><li><a href=/commands/client-list> <strong> CLIENT LIST </strong> </a><li><a href=/commands/client-no-evict> CLIENT NO-EVICT </a><li><a href=/commands/client-pause> CLIENT PAUSE </a><li><a href=/commands/client-reply> CLIENT REPLY </a><li><a href=/commands/client-setname> CLIENT SETNAME </a><li><a href=/commands/client-tracking> CLIENT TRACKING </a><li><a href=/commands/client-trackinginfo> CLIENT TRACKINGINFO </a><li><a href=/commands/client-unblock> CLIENT UNBLOCK </a><li><a href=/commands/client-unpause> CLIENT UNPAUSE </a><li><a href=/commands/echo> ECHO </a><li><a href=/commands/hello> HELLO </a><li><a href=/commands/ping> PING </a><li><a href=/commands/quit> QUIT </a><li><a href=/commands/reset> RESET </a><li><a href=/commands/select> SELECT </a></ul></aside></div></article></div></div><footer class=site-footer><div class=container><p>This website is <a href=https://github.com/redis/redis-io> open source software </a> and is sponsored by <a href=https://redis.com> Redis Ltd. </a> See all <a href=/topics/sponsors> credits </a> .</div></footer></div><script src=https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js></script><script src=/app.js?1593522358></script><script async src=/_Incapsula_Resource?SWJIYLWA=719d34d31c8e3a6e6fffd425f7e032f3&ns=2&cb=950507662></script>