{"id":13692579,"url":"https://github.com/git-hulk/rdbtools","last_synced_at":"2025-05-02T19:32:21.133Z","repository":{"id":19688965,"uuid":"22943345","full_name":"git-hulk/rdbtools","owner":"git-hulk","description":"rdb parser tools for redis, implemented in C, use lua to format key-value.","archived":true,"fork":false,"pushed_at":"2016-04-20T15:41:17.000Z","size":700,"stargazers_count":45,"open_issues_count":2,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-12T18:41:41.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/git-hulk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-14T06:18:06.000Z","updated_at":"2023-11-23T08:02:38.000Z","dependencies_parsed_at":"2022-09-09T09:01:20.620Z","dependency_job_id":null,"html_url":"https://github.com/git-hulk/rdbtools","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-hulk%2Frdbtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-hulk%2Frdbtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-hulk%2Frdbtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-hulk%2Frdbtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-hulk","download_url":"https://codeload.github.com/git-hulk/rdbtools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095390,"owners_count":21693909,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T17:00:59.655Z","updated_at":"2025-05-02T19:32:20.458Z","avatar_url":"https://github.com/git-hulk.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# rdbtools [![Build Status](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n\nA tool use c to analyze redis rdb file, and use lua to handle.\n\n\u003e Notice: This tools was tested on 2.2 , 2.4 , 2.6, 2.8\n\n\u003e bugs in other versions? open issues, I will fix it, thanks~\n\n\n\n#### 1. What about this tool to do? \n\n\u003e use lua to parse rdb file to user's format data, like aof file, json etc.\n\n\n#### 2. How to use?\n```shell\n$ cd rdbtools/src\n$ make\n$ ./rdbtools -f ../tests/dump2.4.rdb -s ../scripts/example.lua\n```\n\nNOTE: Compile error with readline.h is not found, just use yum or apt-get to install readline and readline-devel\n#### 3. Options\n\n```shell\nUSAGE: ./rdbtools [-f file] -V -h\n    -V --version \n    -h --help show usage \n    -f --file specify which rdb file would be parsed.\n    -s --file specify which lua script, default is ../scripts/example.lua\n```\n\nIf you want to handle key-value in rdb file, you can use `-s your_script.lua`, and lua function `handle` will be callbacked.\n\nExample can be found in `scripts/example.lua`, and it just print the key-value.\n\n\n##### Json format example\n\n`cat scripts/json_exapmle.lua`\n\n```lua\nlocal cjson = require \"cjson\"\n\nfunction handle(item)\n     print(cjson.encode(item))\nend     \n```\n\nAnd result is below:\n![image](https://raw.githubusercontent.com/git-hulk/rdbtools/master/snapshot/rdbtools-to-json.png)\n\n#### 4. Params in handle function\n\n```lua\nfunction handle(item)\n --item.type, value may be string, set, zset, list, or hash.\n --item.expire_time, key expire time .\n --item.value, may be string or list or hash, it depends on item.type\nend\n```\n\n\n#### 5. Environment\n\nIf you what to know rdb version and which db is selcted.\n\n```lua\nprint(env.version)\nprint(env.db_num)\n```\n\n#### 6. Contact me?\n\u003e ```Sina Weibo```: [@改名hulk](http://www.weibo.com/tianyi4)\n\n\u003e```Gmail```: [hulk.website@gmail.com](mailto:hulk.website@gmail.com)\n\n\u003e```Blog```: [www.hulkdev.com](http://www.hulkdev.com)\n\nany bugs? send mail, and I will appreciate your help.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-hulk%2Frdbtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-hulk%2Frdbtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-hulk%2Frdbtools/lists"}