possible fix for #10

This commit is contained in:
GilbN 2022-01-10 13:11:56 +01:00 committed by GitHub
parent 7edef5a6fb
commit e99b46b510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -211,12 +211,12 @@ def logparse(
geohash_tags['host'] = hostname
geohash_tags['country_code'] = info.country.iso_code
geohash_tags['country_name'] = info.country.name
geohash_tags['state'] = info.subdivisions.most_specific.name
geohash_tags['state_code'] = info.subdivisions.most_specific.iso_code
geohash_tags['city'] = info.city.name
geohash_tags['postal_code'] = info.postal.code
geohash_tags['latitude'] = info.location.latitude
geohash_tags['longitude'] = info.location.longitude
geohash_tags['state'] = info.subdivisions.most_specific.name if info.subdivisions.most_specific.name else "-"
geohash_tags['state_code'] = info.subdivisions.most_specific.iso_code if info.subdivisions.most_specific.iso_code else "-"
geohash_tags['city'] = info.city.name if info.city.name else "-"
geohash_tags['postal_code'] = info.postal.code if info.postal.code else "-"
geohash_tags['latitude'] = info.location.latitude if info.location.latitude else "-"
geohash_tags['longitude'] = info.location.longitude if info.location.longitude else "-"
ips['tags'] = geohash_tags
ips['fields'] = geohash_fields
ips['measurement'] = geo_measurement