Questions tagged [redis-cli]

redis-cli is the command line interface that is installed when installing Redis.

redis-cli 3.0.5

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
  -p <port>          Server port (default: 6379).
  -s <socket>        Server socket (overrides hostname and port).
  -a <password>      Password to use when connecting to the server.
  -r <repeat>        Execute specified command N times.
  -i <interval>      When -r is used, waits <interval> seconds per command.
                     It is possible to specify sub-second times like -i 0.1.
  -n <db>            Database number.
  -x                 Read last argument from STDIN.
  -d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).
  -c                 Enable cluster mode (follow -ASK and -MOVED redirections).
  --raw              Use raw formatting for replies (default when STDOUT is
                     not a tty).
  --no-raw           Force formatted output even when STDOUT is not a tty.
  --csv              Output in CSV format.
  --stat             Print rolling stats about server: mem, clients, ...
  --latency          Enter a special mode continuously sampling latency.
  --latency-history  Like --latency but tracking latency changes over time.
                     Default time interval is 15 sec. Change it using -i.
  --latency-dist     Shows latency as a spectrum, requires xterm 256 colors.
                     Default time interval is 1 sec. Change it using -i.

  --lru-test <keys>  Simulate a cache workload with an 80-20 distribution.

  --slave            Simulate a slave showing commands received from the master.
  --rdb <filename>   Transfer an RDB dump from remote server to local file.
  --pipe             Transfer raw Redis protocol from stdin to server.
  --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.
                     no reply is received within <n> seconds.
                     Default timeout: 30. Use 0 to wait forever.
  --bigkeys          Sample Redis keys looking for big keys.
  --scan             List all keys using the SCAN command.
  --pattern <pat>    Useful with --scan to specify a SCAN pattern.
  --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
                     The test will run for the specified amount of seconds.
  --eval <file>      Send an EVAL command using the Lua script at <file>.
  --help             Output this help and exit.
  --version          Output version and exit.

Examples:
  cat /etc/passwd | redis-cli -x set mypasswd
  redis-cli get mypasswd
  redis-cli -r 100 lpush mylist x
  redis-cli -r 100 -i 1 info | grep used_memory_human:
  redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
  redis-cli --scan --pattern '*:12345*'

  (Note: when using --eval the comma separates KEYS[] from ARGV[] items)

When no command is given, redis-cli starts in interactive mode.
Type "help" in interactive mode for information on available commands.
278 questions
1
vote
2 answers

Cannot get matching keys from Redis using redis-cli

I have this: $ redis-cli -n 2 -h "$host" GET events:from_bitbucket:fc2c0983-d0f2-4211-aa2e-5382afd9b288 "[object Object]" $ redis-cli -n 2 -h "$host" GET 'events:from_bitbucket:*' (nil) why does the first query work, but the second query responds…
user7898461
1
vote
1 answer

How to understand Redis Monitor output?

I'm working with a redis instance locally with a PHP app. I'm getting the following output from redis-cli monitor: 1550597216.002208 [1 127.0.0.1:36484] "DEL" "XXXXXX:1745715486" The key-value is still there but if I do it with…
popopow
  • 36
  • 7
1
vote
0 answers

redis-cli unix socket - import rcmd failing

I am using redis server 3.0.6 on ubuntu 16.04 desktop. Installed using apt-get install redis-server It was working fine for a long time. Today, when I tried to import a rcmd file using unix socket in redis-cli I am getting out of memory error. $…
1
vote
1 answer

AWS Cloudwatch Metrics showing different number of current connections than redis-cli

When I look at the Cloudwatch metrics for a redis cache it reports that there are 3 current connections. When I use the CLIENT LIST command through redis-cli the only connection it reports is the ec2 instance that I am using redis-cli from. I…
1
vote
1 answer

Read data of a redis container from the host machine

I set up with docker-compose a redis container and a node app which uses the redis DB. All works but I didn't mount any volume so I can't access the data of the redis DB from the host. I also tried to deplou a container with another node app which…
room13
  • 883
  • 2
  • 10
  • 26
1
vote
1 answer

change redis command prompt text

I have a free-tier Redis Enterprise instance on AWS. I am running the latest stable version of redis on my Mac. I can connect to my Redis Enterprise instance using redis-cli with the -h parameter, and I get an interactive session which allows me to…
EricF
  • 173
  • 7
1
vote
0 answers

Laravel Redis Failed work:queue --tries=3 --stop-when-empty

I have Queue work failed issue with Laravel 5.7 when i dispatch my job into redis queue.So any one can help on this? public function forgotPassword(Request $request) { $validator = Validator::make($request->all(), [ 'email' =>…
Manish J
  • 686
  • 1
  • 8
  • 24
1
vote
1 answer

How to set to redis value if the value contain multiline?

I am not able to set multiline value to redis? is there any better way to do?
Oktaheta
  • 606
  • 5
  • 21
1
vote
1 answer

cjson decode in Lua returns array of empty arrays redis-cli

I've got a large JSON array of objects stored in redis as an encoded string. local string_foo = redis.call("get",…
phillercode
  • 339
  • 1
  • 14
1
vote
1 answer

Unable to connect Redis Client if I changed the IP and port in redis conf file

If I changed the IP from 127.0.0.1 to my Local IP in redis.conf file and I starts the redis client(redis-cli.exe), It's giving a blanck screen.Redis-client console Can any one please tell me the solution, how to strat redis-client in this scenario.
Manohar
  • 19
  • 6
1
vote
0 answers

Run redis-cli when redis is running like a service

I have a problem with Redis and redis-cli. I have running Redis like a service in windows, like you can see in the picture but when I try to run "redis-cli" it doesn't anything, the console is frozen I need to monitoring all messages with…
Felipe Pincheira
  • 442
  • 1
  • 6
  • 21
1
vote
1 answer

How to clear redirected keys from redis cluster nodes

I've come across an interesting (not to say infuriatingly annoying) issue. I'm fairly new to Redis but I know how to operate the basics. Basically I have a cluster with 3 masters and each master has 2 slaves each across three servers. I have a bunch…
Almund
  • 5,695
  • 3
  • 31
  • 35
1
vote
1 answer

Does redis key size also include the data size for that key or just the key itself?

I'm trying to analyise the db size for redis db and tweak the storage of our data per a few articles such as https://davidcel.is/posts/the-story-of-my-redis-database/ and…
Avba
  • 14,822
  • 20
  • 92
  • 192
1
vote
1 answer

sort set in redis with hash in the collection

We have created 3 hash in redis using the REPL redis-cli in this way: hmset redishop:items:Articulo1 artist "Martin Wessely" price 12.99 name "Handcrafted Trees Mug" hmset redishop:items:Articulo2 artist "Martin Wessely" price 13.99 name…
charles
  • 361
  • 1
  • 5
  • 15
1
vote
1 answer

Save redis client list to file

I'm investigating issues with redis and a high number of clients (above the default limit of 10000). Although the CLIENT LIST command works fine, one can't do much with it. I would like to save it to a file, so as to run some metrics (sort by ip,…
Antoine
  • 5,055
  • 11
  • 54
  • 82