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

How to set Redis to be case insensitive while filtering keys?

I am using redis to set and filter key value pair in my application. But it return always case sensitive data while filtering using HSCAN. I need to get case insensitive data from redis. How can I get this? How to set Redis to be case…
SST
  • 2,054
  • 5
  • 35
  • 65
4
votes
1 answer

(error) ERR unknown command 'XTRIM' on redis-cli

I am getting ERROR: "(error) ERR unknown command 'XTRIM'" while running on redis-cli. 127.0.0.1:6379> info # Server redis_version:3.2.12 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:7897e7d0e13773f redis_mode:standalone os:Linux…
sam
  • 81
  • 1
  • 7
4
votes
1 answer

Using Redis-CLI on Redis container

Hello i am trying to issue commands to a Redis docker container. The container is up and running.I have used the following command: docker run -d -p 8300:85 -t redis However when i try to use from my terminal: redis-cli -p 8300 nothing happens.It…
Bercovici Adrian
  • 8,794
  • 17
  • 73
  • 152
4
votes
2 answers

How to optimize redis cli script to process 50 millions of key

I wrote below bash script to process redis key and value. I've around 45-50 millions of keys in my Redis. I want to retrieve all values and do some processing. To do that my below script is taking 1 hour to process 1 millions of key. In order to…
learn java
  • 231
  • 3
  • 14
4
votes
3 answers

Clearing Azure Redis Cache using PowerShell during deployment

When deploying new versions of our web application to Azure App Service, I have a requirement to clear out the data in the associated Azure Redis Cache. This is to ensure that we don't return old versions of items which have schema changes in the…
4
votes
4 answers

Delete keys from redis server using redis-cli

I am trying to delete the KEYS using pattern from redis server but it is not getting deleted. Sample Keys 1) "flc_77sandeep-pant-back.int.dev.mykronos.com_personality:\xac\xed\x00\x05w\x03\t\xa0\x01" 2)…
hardy_sandy
  • 361
  • 4
  • 6
  • 13
4
votes
3 answers

Cant connect redis-cli with amazon elastic cache

I have created a redis endpoint on amazon elastic cache and also setup vpc & NAT gateway. I need to connect created redis endpoint with redis-cli. i using command like this redis-cli -h dev-redis.434dffsdsf.0094.ustyue1.cache.amazonaws.com But i…
Abdul Manaf
  • 4,933
  • 8
  • 51
  • 95
4
votes
1 answer

(error) ERR unknown command 'debug'

Redis version: redis_version:2.8.19 I'm trying to launch this tool: https://github.com/snmaynard/redis-audit But it fails with the following error: /var/lib/gems/2.1.0/gems/redis-3.3.2/lib/redis/pipeline.rb:129:in `value': ERR unknown command…
evgeniy44
  • 2,862
  • 7
  • 28
  • 51
4
votes
4 answers

How to Identify Redis performance/Bottlenecks

I wan to know that how to check the performance of Redis server and what could be bottleneck. I have run redis-cli -h 127.0.0.1 -p 6379 --stat command and get following stats. if some can suggest what needs to be done and what other mtrics need to…
Amritpal Singh
  • 1,765
  • 1
  • 13
  • 20
4
votes
1 answer

redis cluster dbsize shows keys only on that node

I'm connecting to a redis cluster node using redis-cli -c -p 7001 When I issue info command or dbsize command, I get the count of keys that only reside on that node, and not the count of all the keys across all the nodes in my cluster. However,…
sreeraag
  • 513
  • 1
  • 5
  • 19
3
votes
1 answer

Redis cli - KEYS * not showing all keys

I am connecting to an AWS redis cluster using following command redis-cli -c -h host.amazonaws.com -p 6379 I pushed two key "X1" and "X2" into redis cache from a springboot application (API methods are not annotated with @Cacheable) and now when I…
7msseven
  • 45
  • 1
  • 6
3
votes
1 answer

filtering redis monitor lpush

I have a box that has a lot of redis stuff going on. I converted my code from writing to a channel to doing a lpush. To see how my output I used redis-cli's monitor command. Is there a way to filter the monitor to command to show only the lpush…
chowpay
  • 1,515
  • 6
  • 22
  • 44
3
votes
3 answers

Is there a way to save encrypted password in redis.conf?

I want to add password to Redis. I interested if there is a way to save encrypted password in redis.conf and not as plain text? Or a way not to store the password in redis.conf at all?
Maria Dorohin
  • 355
  • 4
  • 17
3
votes
2 answers

Restart redis server from rdb restoring expired keys

I got snapshot rdb file from server. At the point of snapshoting there was keys with defined ttl using EXPIRE command . After starting server locally with the key --dbfilename dump.rdb all keys with defined ttl expired. For me it seems that there…
Oleksandr
  • 2,346
  • 4
  • 22
  • 34
3
votes
3 answers

Redis incrementing a numeric value - ERR value is not an integer or out of range

Redis incr function behaves erratically. When trying to increment any positive integer key that has not been set yet, it results in the following error. However, when first setting it by set then incrementing using incr for the same key, the problem…
Ahmadov
  • 1,567
  • 5
  • 31
  • 48
1 2
3
18 19