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
0 answers

Redis mass insert problem "ERR Protocol error: too big mbulk count string"

UPDATE I split the file into multiple files each roughly with 1.5 million lines and no issues. Attempting to pipe into Redis 6.0.6 roughly 15 million lines of SADD and HSET commands properly formatted to Redis Mass Insertion but it fails with the…
1
vote
2 answers

Bash - If statement performing empty comparision

I know this sounds silly, but had a rough start in this week and i'm not able to think clearly. I'm writing this simple piece of code, which is suppose to get little complex later on. However I'm stuck near this simple If condition statement. I…
theborngeek
  • 121
  • 1
  • 7
1
vote
1 answer

How to connect to redis sentinel and manipulate different dbs

I am struggling to connect redis in sentinel mode using redis-cli. I've tried: redis-cli -h my_host -p my_port -a my_password I randomly picked up one from 3 sentinel nodes to connect. However, when logged in, it seems different with single mode…
Shu
  • 187
  • 1
  • 13
1
vote
1 answer

Syntax error using CLIENT KILL USER on Redis 5.9.102

I'm trying to kill a Redis client by user, as per the docs, but I get a syntax error in redis-cli: redis:6379> client kill user my_client (error) ERR syntax error redis:6379> info # Server redis_version:5.9.102 What's the correct syntax for this…
Alex Deva
  • 17
  • 5
1
vote
1 answer

redis-cli from docker-compose redis container doesn't catch any keys set up through Laravel

So when I enter the redis container with: docker-compose exec redis bash, I then type: redis-cli to start redis-cli. Then, when I try to get the key (visits) I set up through Laravel app with: GET visits, it shows nil. This is how I set up the key…
1
vote
0 answers

Redis-cli not connecting to redis-server

I have a redis-server instance running, everything works fine if I try to connect to it via code e.g python. The problem is, redis-cli tool doesn't connect. Here's what I get when I run redis-cli: Could not connect to Redis at 127.0.0.1:6379: � not…
Wafula Samuel
  • 530
  • 1
  • 8
  • 25
1
vote
1 answer

SignalR Redis backplane implementation

Set up redis backplane per article: https://learn.microsoft.com/en-us/aspnet/core/signalr/redis-backplane?view=aspnetcore-3.1, how would one view published messages in redis?. I want to make sure redis pub/sub is actually being used without…
ShaneKm
  • 20,823
  • 43
  • 167
  • 296
1
vote
1 answer

How to initiate, increment and set expiration in the same Redis command?

INCR mykey initiates to 0 and increments the value to 1. How would I set expiration time to the mykey in the same command like it can be done with SETEX ?
Robert C. Holland
  • 1,651
  • 4
  • 24
  • 57
1
vote
1 answer

Unrecognized option or bad number of args for: '--evalsha'

When I run redis-cli script load "$(cat ./scripts/restoreSymbols.lua)" for the following script: local list = {} local result = redis.call('scan', 0, 'MATCH', 'symbol:*', 'COUNT', 1000) for _, v in ipairs(result[2]) do list[#list+1] =…
Maarten Raaijmakers
  • 615
  • 2
  • 8
  • 20
1
vote
1 answer

Is it possible to see all the requests processed by redis?

I want to get all the commands processed by redis without using MONITOR command because MONITOR command is used to get info of all commands at present.But this is not my case.I want to know the commands processed for last 2 days.Is it possible to…
Praga_t
  • 532
  • 3
  • 15
1
vote
2 answers

Clear Redis-Cli history on Windows machine

Every time i open Redis-Cli tool , I can see my past entered commands including passwords. How can i clear the history of Redis-Cli
Abbas Ghomi
  • 139
  • 1
  • 7
1
vote
0 answers

Can't use redis-cli within a docker container that has redis installed

I am working on a Python-Flask project that has two separate docker containers for the web app and the postgres database. I want to start using rq and redis with the web app, so I added a docker container that holds the redis server. When I tried…
ByteByByte
  • 303
  • 1
  • 2
  • 11
1
vote
3 answers

installed django-redis in python virtualenv, redis-cli command not found

I just install django-redit using pip in my python virtualenv,but when I enter command redis-cli, it shows me redis-cli command not found. I'm pretty much sure redis-cli has been installed sucessfully. need your help thx in advance
Chase.yang
  • 13
  • 5
1
vote
1 answer

How to delete a key using HDEL if the key have space with it

I am using Ruby 2.5.1 and trying to delete keys from redis using HDEL. But it doesn't work key with spaces. I can delete with the quotes from redis-cli but I need to write a code to delete keys with space. Sample value ["play group_1",…
SST
  • 2,054
  • 5
  • 35
  • 65
1
vote
1 answer

How can I update HKEYS field if there eixists in redis using Ruby on Rails

I am using ruby 2.5.1. I did store keys in redis using HKEYS and filter keys using HSCAN. I need to modify HKEYS if the key already exists. How can I update HKEYS field if there exists in redis using Ruby on Rails?
SST
  • 2,054
  • 5
  • 35
  • 65