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

how to delete all matching keys in redis on teminal

i want to delete keys with matching pattern directly from the redis-cli terminal not running cmd on bash script as given in this thread /home/ubuntu> redis-cli -h 10.244.0.85 10.244.0.85:6379> --> what should i type here to delete all…
0
votes
0 answers

Error Handling when using Redis Bulk Import

I'm using redis-cli to do some bulk importing 800mil keys transfer. When I use it if some command was not able to execute for some reason how do I know which command failed the output won't say which command failed so that I can retry etc. Any…
Sheldom
  • 21
  • 1
  • 4
0
votes
0 answers

Adding a string value as member in redis sorted set using C application

In my C application as shown below I am trying to add a string as the member in a redis sorted set. Looks like it is not working as expected #include #include #include #include int main() { …
codingfreak
  • 4,467
  • 11
  • 48
  • 60
0
votes
2 answers

How to modify maxmemory on Redis cloud

redis.exceptions.ResponseError: OOM command not allowed when used memory > 'maxmemory'. Im getting above error and I tried setting up through redis-cli, the maxmemory config is not available. It has only below attribute. CONFIG GET…
Shashikumar KL
  • 1,007
  • 1
  • 10
  • 25
0
votes
1 answer

How to check current aof/rdb enableness status on a running redis server cli and how to enable them?

How to check current aof/rdb enableness status on a running redis server's cli ? How to enable them on cli ? I'm using redis 6.
djy
  • 737
  • 6
  • 14
0
votes
1 answer

Delete Specific value from redis hash field value

I have redis hash, i want to delete the specific value of field. 127.0.0.1:6379> hset abc 12 34,121 (integer) 1 127.0.0.1:6379> hgetall abc 1) "12" 2) "34,121" I only want to delete 121 from value. I know hdel command deletes the field but not…
0
votes
1 answer

Fetch keys which are older than 10 days from redis

I am trying to fetch the keys from Redis which are older than 10 days. I am using Zrange to fetch the old keys which are saved based on timestamp. I am getting this error when I run the last command ERR value is not an integer or out of range.Any…
Aniket Tiwari
  • 3,561
  • 4
  • 21
  • 61
0
votes
0 answers

Redis returning "-1" for absent key while redirecting to slot. What could be the reason for this?

clustercfg.application-cluster.wtdhdu.memorydb.eu-west-1.amazonaws.com:6379> KEYS count:followers:24c2b81c-17b4-443d-95b3-1c78cb4644d1 (empty array) clustercfg.application-cluster.wtdhdu.memorydb.eu-west-1.amazonaws.com:6379> GET…
Anonymous
  • 33
  • 4
0
votes
0 answers

docker redis server get/set command issue

I'm asking you a question because I need your help. I have built a redis server in a docker container and am using it in cluster mode. I can access the redis server and ping well. However, when executing the get/set command, the following error…
A J
  • 1
0
votes
1 answer

Batch / offline methods of converting RESP files to Redis RDB file

Assuming we want to automate the process of creating RDB files (and don't want to use Redis server for this purpose) what options are available? The current process involves importing (with redis-cli) a set of RESP files to a Redis server and then…
mirekphd
  • 4,799
  • 3
  • 38
  • 59
0
votes
2 answers

Hosting Redis on EC2 - ConnectionTimeoutError

I have an EC2 instance behind a load balancer. The security group attached to it allows for inbound connections (both ipv4 and ipv6 on port 6379). I am able to connect to my redis client: redis-cli -h ec2-**-**-**-*.us-west-1.compute.amazonaws.com…
0
votes
1 answer

Is there a way to disable command 'keys *' in Redis?

I'm using AWS elastic cache Redis. I saw that Warning: consider KEYS as a command that should only be used in production environments with extreme care in Redis Documentation. If I want to disable the 'key' command, Is there a way to disable command…
bbuljj
  • 93
  • 6
0
votes
0 answers

saving redis-cli command response to file using c#

I am trying to bulk add keys to my redis server using type filename.txt | redis-cli --pipe. This works well and all data inserted successfully and i can see response in cmd window. but when tried with c# app then response file is always empty. here…
uddi baba
  • 135
  • 2
  • 13
0
votes
1 answer

Can I run Redis CLI command line options from the Lua API?

I want to run redis-cli --bigkeys on my Redis cluster to evaluate the memory usage, and perform a SCAN across the key space to trigger an active expiry. However, for permissions reasons I only have access to run commands via the Lua API. Is it…
harveyives
  • 105
  • 8
0
votes
1 answer

Stroing large entry in redis using cli?

I am trying to store data of 5000 characters in redis via cli. My command is SET MY_KEY "copy pasted the value" But the whole value is not getting pasted in CLI. Is there any alternative to it. I have redis version 3.0.54
WISHY
  • 11,067
  • 25
  • 105
  • 197