-- redis-cli -a hc --ldb --eval secondtimelogin.lua mykey key , 0 10000 jdi 3021081616280006280431 local result = redis.call('scan',ARGV[1],'count',ARGV[2],'match',ARGV[3]..'*') redis.debug(ARGV[1]..","..ARGV[2]..","..ARGV[3]..","..ARGV[4]) local dataList = result[2] local result1 = {} local j = 1;
for i=1,#dataList do local jdikey = dataList[i] redis.debug(jdikey) local jdiValue = redis.call('get',jdikey) redis.debug(jdiValue) local finds = string.find(jdiValue,ARGV[4]) redis.debug(finds) if(finds ~= nil) then local item = {} item['key'] = jdikey item['value'] = jdiValue result1[j]=item j = j+1 end end