https://github.com/7c/mmdbmerge
one of multiple files can be combined into single mmdb file
https://github.com/7c/mmdbmerge
Last synced: 11 months ago
JSON representation
one of multiple files can be combined into single mmdb file
- Host: GitHub
- URL: https://github.com/7c/mmdbmerge
- Owner: 7c
- Created: 2025-01-29T23:37:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-30T00:03:16.000Z (over 1 year ago)
- Last Synced: 2025-04-05T11:25:31.824Z (about 1 year ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mmdbmerge
A tool to merge multiple MaxMind DB files into a single file. It will skip all data from all files and add "from" property to indicate which file the data came from. You may want to use [mmdbinspect](https://github.com/maxmind/mmdbinspect) or [mmdimport](https://github.com/7c/mmdbimport) to view the data.
## Installation
Easy way to install this tool is to use `go install` command.
```bash
go clean -cache
go install github.com/7c/mmdbmerge@v0.0.4
```
## Release
You can download the release from [releases folder](https://github.com/7c/mmdbmerge/releases).
## Build
If you want to build this tool from source, you can use `make` command.
```bash
$ make build
$ bin/mmdbmerge -h
```
## Usage
```bash
$ mmdbmerge a.mmdb b.mmdb [input3.mmdb ...] -o combined.mmdb [--debug]
2025/01/29 18:31:18 VALID: Valid file: demo/a.mmdb
2025/01/29 18:31:18 VALID: Valid file: demo/b.mmdb
2025/01/29 18:31:18 Stats: demo/a.mmdb networks: 2166 (IPs: 681413, skipped: 0)
2025/01/29 18:31:18 Stats: demo/b.mmdb networks: 2166 (IPs: 681413, skipped: 0)
2025/01/29 18:31:18 Final Stats: Total networks: 4332 (IPs: 1362826, skipped: 0)
2025/01/29 18:31:18 Output: combined.mmdb contains 906 networks (IPs: 681413)
% mmdbimport -v combined.mmdb
MMDB file: combined.mmdb
Build Timestamp: 2025-01-29T18:31:18-05:00
Database Information:
Binary Format: 2.0
IP Version: 6
Record Size: 28 bits
Node Count: 7436
Metadata:
Database Type: Combined-DB
Description:
en: Combined a, b
Languages: en
Statistics:
Total Networks: 906
$ mmdbinspect -db combined.mmdb 212.102.44.4
[
{
"Database": "combined.mmdb",
"Records": [
{
"Network": "212.102.32.0/19",
"Record": {
"from": "b"
}
}
],
"Lookup": "212.102.44.4"
}
]
```
the mmdb driver optimizes overlaps internally, thanks!