Hi Folks -
Looking for some examples or hints in order to leverage lua_parser && redis2. To date, I've been using httpredis and content_by_lua code to perform a number of simple 'get's which has worked well. Now, I'd like to pipeline a number of redis requests together in order to leverage 'auth' within redis and eventually pipeline numerous 'get's at once.
This is what I have working so far, appreciate any assistance or commentary...
location /redis2 {
set $key $http_host;
redis2_query auth foobar;
redis2_query get $key;
redis2_pass redis-backend;
}
This auth + get works great and yields the following as expected:
+OK
$12
blahblahblah
Goal 1:
I'd like to be able to strip out the +OK\r\n$12\r\n and be left with the actual value of blahblahblah. Hints or example?
Goal 2:
Eventually I'd like to be able to pipeline an 'auth' plus numerous 'gets' together and leverage each value, if a $-1 isn't returned for a 'get', ie:
location /redis2 {
set $key $http_host;
set $key2 $http_host:some_arbitrary_value;
redis2_query auth foobar;
redis2_query get $key;
redis2_query get $key2;
redis2_pass redis-backend;
}
Thanks in advance for any pointers...