Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

import: JSON input processing supports --fields and --fields-from-header flags #37

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

max-ipinfo
Copy link
Contributor

These flags were only supported for CSV and TSV inputs.

Testing

Using https://github.com/ipinfo/sample-database/blob/main/IP%20Geolocation/ip_geolocation_sample.json:

$ mmdbctl import --json --fields city,region,country --in ip_geolocation_sample.json --out ./test.mmdb ; mmdbctl export test.mmdb | head -n2
writing to ./test.mmdb (100 entries)
range,city,country,network,region
14.3.247.44/31,Isesaki,JP,14.3.247.44-14.3.247.45,Gunma

$ mmdbctl import --json --in ip_geolocation_sample.json --out ./test.mmdb ; mmdbctl export test.mmdb | head -n2
writing to ./test.mmdb (100 entries)
range,city,country,latitude,longitude,network,postal_code,region,timezone
14.3.247.44/31,Isesaki,JP,36.31667,139.2,14.3.247.44-14.3.247.45,321-4342,Gunma,Asia/Tokyo

…m-header` flags

These flags were only supported for CSV and TSV inputs.
@max-ipinfo max-ipinfo requested a review from fayzanx August 6, 2024 23:26
@max-ipinfo max-ipinfo merged commit e129095 into master Aug 7, 2024
@max-ipinfo max-ipinfo deleted the maximecurioni/import-json-fields-flags branch August 8, 2024 01:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants