rgeolocate icon indicating copy to clipboard operation
rgeolocate copied to clipboard

asn field is showing NA even when available in MaxMind

Open Uriel-Carrasquilla opened this issue 3 years ago • 3 comments

asn option in rgeolocate not working when accessing MaxMind Enterprise database.

Uriel-Carrasquilla avatar Jan 27 '22 01:01 Uriel-Carrasquilla

when using inspect, I get the autonomous system. when using rgeolocate, it shows "NA" i.e. not-available. ./mmdbinspect -db ~/geoip/GeoIP2-Enterprise.mmdb 172.217.5.100 [ { "Database": "/home/uriel/geoip/GeoIP2-Enterprise.mmdb", "Records": [ { "Network": "172.217.5.100/19", "Record": { "continent": { "code": "NA", "geoname_id": 6255149, "names": { "de": "Nordamerika", "en": "North America", "es": "Norteamérica", "fr": "Amérique du Nord", "ja": "北アメリカ", "pt-BR": "América do Norte", "ru": "Северная Америка", "zh-CN": "北美洲" } }, "country": { "confidence": 99, "geoname_id": 6252001, "iso_code": "US", "names": { "de": "USA", "en": "United States", "es": "EE. UU.", "fr": "États Unis", "ja": "アメリカ", "pt-BR": "EUA", "ru": "США", "zh-CN": "美国" } }, "location": { "accuracy_radius": 1000, "latitude": 37.751, "longitude": -97.822, "time_zone": "America/Chicago" }, "registered_country": { "geoname_id": 6252001, "iso_code": "US", "names": { "de": "USA", "en": "United States", "es": "EE. UU.", "fr": "États Unis", "ja": "アメリカ", "pt-BR": "EUA", "ru": "США", "zh-CN": "美国" } }, "traits": { "autonomous_system_number": 15169, "autonomous_system_organization": "GOOGLE", "connection_type": "Corporate", "domain": "1e100.net", "isp": "Google Cloud", "organization": "Google Cloud", "user_type": "hosting" } } } ], "Lookup": "172.217.5.100" } ]

results when using maxmind in the rgeolocate package from R CLI. Notice the "asn" request.

maxmind("172.217.5.100", maxmind_file, c("continent_name", "country_code", "city_name", "latitude", "longitude","asn"))

returns: continent_name country_code city_name latitude longitude asn 1 North America US <NA> 37.751 -97.822 NA

the maxmind_file points to the MaxMind enterprise database in R:

maxmind_file [1] "~/geoip/GeoIP2-Enterprise.mmdb"

Uriel-Carrasquilla avatar Jan 27 '22 01:01 Uriel-Carrasquilla

Any pointers on how to fix - I've just bought the commercial DB-IP database and want the traits data.

Never hacked on a R module before...

nhi-vanye avatar Apr 25 '23 08:04 nhi-vanye

I've got a fix that works for me, PR soon...

nhi-vanye avatar Apr 26 '23 07:04 nhi-vanye