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
0
votes
1 answer

Cyrillic in redis

Using redis-cli, I add data in Cyrillic to the redis queue, if using redis-cli to get the queue data, we will see "\xaf\xe0\xae\xa1\xa0". In GO msg, _ := redis.String(R.conn.Do("LPOP", key)) result How can I get the Cyrillic alphabet? I tried…
0
votes
1 answer

How to run a Windows command from any folder?

Some CLI commands work from only specific folders; I want to make them run globally, from anywhere. I installed redis-cli.exe in the path c:/redis/redis-cli.exe. Now when I open a cmd in c:/redis/ and run redis-cli ping, it works. However, if I run…
Bojan Krkic
  • 349
  • 3
  • 10
0
votes
0 answers

How can I ensure that this Python RQ task on a Redis server is being executed?

In a Flask app, I have a function that takes a list of lists and adds each as a row to an Excel file. This function works fine on a development server when the request won't time out. Here it is wrapped in a try/except block. This is how I need to…
Peter Charland
  • 409
  • 6
  • 18
0
votes
1 answer

Redis-cli keys "And" & "Or" commands

I'm doing some validations on Redis using redis-cli with the following command redis-cli --scan --pattern XXX:YYY:* |…
Luis Urea
  • 107
  • 3
  • 12
0
votes
0 answers

Redis service automatically stops after few minutes of running

On my Ubuntu machine, redis server was running fine and suddenly it stops. After I started it, again it automatically stops after few minutes. So I start again, and so on. Why is this happening? Here are the logs when I start redis: 21479:C 29 Apr…
0
votes
0 answers

How can i filter messages on redis-cli

I am storing messages in JSON format on redis. Is there any way to filter those messages from redis-cli on the basis of attribute values?
Amal Jose
  • 21
  • 4
0
votes
1 answer

Batch file to flush redis client locally

I want to flush redis server through batch file so I am trying to create batch file with following command but it doesn't work for me. SET REDIS_PATH=C:\Redis "%REDIS_PATH%\redis-cli" FLUSHALL
Jeevan Gharti
  • 451
  • 1
  • 7
  • 15
0
votes
0 answers

Why redis.conf is become a directory after Redis docker container created

I'm trying to create Redis cluster and one of its container with command: docker run -d -v cluster-config.conf:/usr/local/etc/redis/redis.conf --name redis-1 redis redis-server /usr/local/etc/redis/redis.conf The same way I create another…
Vadim Yangunaev
  • 1,817
  • 1
  • 18
  • 41
0
votes
1 answer

Redis: redis-cli not asking for password

I have configured my redis.conf with requirepass and I started the server with redis-server redis.conf However, when I run redis-cli it does not ask me for password and lets me connect to redis, but when I try to run a command, asks me for the…
0
votes
2 answers

How to identify Redis keys from Redis-cli monitor command?

Possibly related to - Redis command to get all available keys? I have a Redis server storing SixPack data (https://github.com/sixpack/sixpack - a framework to enable A/B testing). I can monitor the Redis server and see the following sample entries…
Shankar
  • 2,625
  • 3
  • 25
  • 49
0
votes
1 answer

redis-cli info command output changes between redis 3 and redis 5

I have compared the output of "redis-cli info" between redis v3.0.3 and v5.0.5 and I see that many new values are in redis v5.0.5 but the following two are missing: client_longest_output_list client_biggest_input_buf Are these values removed from…
k.szabi
  • 3
  • 1
0
votes
2 answers

How to handle spoon err: Permission Denied in Redis

I'm new to Redis (but already an enthusiastic user) and I'm facing this error on Windows 10 Pro (64 bit) when trying to do the background save of Redis: [14932] 18 Jan 10:57:24 # Failed saving the DB: Permission denied [14932] 18 Jan 10:57:24 #…
Guy_g23
  • 316
  • 2
  • 7
0
votes
3 answers

How to get all redis keys by number range of prefix

I need to get all the keys by prefix of the range of 62-125 and followed by ':' Iv'e tried running the following with no success: res = r.keys('[62-125]:*') Also tried using scan: iter = r.scan_iter('^(6[2-9]|7[0-9]):*') res = [] for key in iter: …
MTZ4
  • 2,274
  • 2
  • 25
  • 41
0
votes
1 answer

cannot run passed Lua script to Redis: This Redis command is not allowed from scripts

I have three instances of Redis server running sentinel and a Lua script in order to let the redis_exporter gather the list of connected clients to the Redis server. but when I pass the script to the redis-cli command I get the following…
Yashar
  • 2,455
  • 3
  • 25
  • 31
0
votes
0 answers

redis command takes long time to fetch data

I have created a bat file for deleting custom data from Redis DB. I have following code @echo off & cls title :Redis Service echo "Redis cache clearing started" for /F "tokens=*" %%f IN ('redis-cli -h 192.134.56.67 -p 6379 -a MyPassword keys…
Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95