Redis-cli --csv option (exporting to csv)

后端 未结 5 2026
轻奢々
轻奢々 2021-02-02 12:34

I would like to export a subset of my Redis data on the slave to a csv file. I notice a new csv output option was added to redis-cli but I am unable to find documentation of ho

5条回答
  •  一生所求
    2021-02-02 13:11

    In case of socket and/or multiple redis servers, you'd need to do:

    redis-cli -s /path/to/socket --csv your-command > stdout.csv 2> stderr.txt
    

    E.g.

    redis-cli -s /var/run/redis/redis4.sock --csv lrange my_list 0 -1 > stdout.csv 2> stderr.txt
    

提交回复
热议问题