You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-db value Path to an mmdb file. You may pass this arg more than once.
29
+
This may also be a glob pattern matching one or more MMDB files.
30
+
-include-aliased-networks
31
+
Include aliased networks (e.g. 6to4, Teredo). This option may
32
+
cause IPv4 networks to be listed more than once via aliases.
33
+
-include-build-time Include the build time of the database in the output.
34
+
-include-networks-without-data
35
+
Include networks that have no data in the database.
36
+
The "record" will be null for these.
37
+
-jsonl Output as JSONL instead of YAML.
38
+
[IP|network] An IP address, or network in CIDR notation. Can be
39
+
specified multiple times.
31
40
```
32
41
33
42
## Description
@@ -36,7 +45,7 @@ Any IPs specified will be treated as their single-host network counterparts (e.g
36
45
37
46
`mmdbinspect` will look up each IP/network in each database specified. For each IP/network looked up in a database, the program will select all records for networks which are contained within the looked up IP/network. If no records for contained networks are found in the datafile, the program will select the record that is contained by the looked up IP/network. If no such records are found, none are selected.
38
47
39
-
The program outputs the selected records as a JSON array, with each item in the array corresponding to a single IP/network being looked up in a single DB. The `database` and `requested_lookup` keys are added to each item to help correlate which set of records resulted from looking up which IP/network in which database.
48
+
The program outputs the selected records in YAML format by default (use `-jsonl` for JSONL format). Each output item corresponds to a single IP/network being looked up in a single DB. Each record contains the following keys: `database_path`, `requested_lookup`, `network`, and `record`. This format allows for efficient streaming of large lookups and makes the key naming more consistent.
40
49
41
50
## Beta Release
42
51
@@ -283,6 +292,35 @@ record:
283
292
```
284
293
</details>
285
294
295
+
<details>
296
+
<summary>Using glob patterns to match multiple database files</summary>
297
+
298
+
```bash
299
+
$ mmdbinspect -db "GeoIP2-*.mmdb" 152.216.7.110
300
+
database_path: GeoIP2-Country.mmdb
301
+
requested_lookup: 152.216.7.110
302
+
network: 152.208.0.0/12
303
+
record:
304
+
continent:
305
+
code: NA
306
+
geoname_id: 6255149
307
+
names:
308
+
de: Nordamerika
309
+
en: North America
310
+
# ... more names
311
+
country:
312
+
geoname_id: 6252001
313
+
iso_code: US
314
+
# ... more country data
315
+
---
316
+
database_path: GeoIP2-City.mmdb
317
+
requested_lookup: 152.216.7.110
318
+
network: 152.216.4.0/22
319
+
record:
320
+
# ... city data
321
+
```
322
+
</details>
323
+
286
324
<details>
287
325
<summary>Look up a file of IPs/networks using the <code>xargs</code> utility</summary>
288
326
@@ -312,7 +350,7 @@ record:
312
350
</details>
313
351
314
352
<details>
315
-
<summary>Tame the output with the <code>-jsonl</code> flag and the <code>jq</code> utility</summary>
353
+
<summary>Processing the output with the <code>-jsonl</code> flag and the <code>jq</code> utility</summary>
# ... All IPs in the database, including all aliased networks.
436
+
```
437
+
</details>
438
+
362
439
## Bug Reports
363
440
364
441
Please report bugs by filing an issue with our GitHub issue tracker at [https://github.com/maxmind/mmdbinspect/issues](https://github.com/maxmind/mmdbinspect/issues).
0 commit comments