Can I save client IP in SET
command in Redis by Redis' engine?
Something like this:
SET my_key $client_ip
Assuming you don't know your $client_ip
, you can do the following:
CLIENT SETNAME
CLIENT LIST
SET
commandExample
127.0.0.1:6379> client getname
(nil)
127.0.0.1:6379> client setname FreddyFrog
OK
127.0.0.1:6379> client getname
"FreddyFrog"
127.0.0.1:6379> client list
id=4 addr=127.0.0.1:49426 fd=6 name=FreddyFrog age=25 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With