diff --git a/geoparser.py b/geoparser.py index c042a78..005fab1 100755 --- a/geoparser.py +++ b/geoparser.py @@ -18,6 +18,7 @@ def logparse(LOGPATH, INFLUXHOST, INFLUXPORT, INFLUXDBDB, INFLUXUSER, INFLUXUSER IPS = {} COUNT = {} GEOHASH = {} + HOSTNAME = os.uname()[1] CLIENT = InfluxDBClient(host=INFLUXHOST, port=INFLUXPORT, username=INFLUXUSER, password=INFLUXUSERPASS, database=INFLUXDBDB) # NOQA GETIP = r"^(?P[0-9]{,3}\.[0-9]{,3}\.[0-9]{,3}\.[0-9]{,3})" @@ -43,6 +44,7 @@ def logparse(LOGPATH, INFLUXHOST, INFLUXPORT, INFLUXDBDB, INFLUXUSER, INFLUXUSER HASH = Geohash.encode(INFO['latitude'], INFO['longitude']) # NOQA COUNT['count'] = 1 GEOHASH['geohash'] = HASH + GEOHASH['host'] = HOSTNAME GEOHASH['country_code'] = INFO['country_code'] IPS['tags'] = GEOHASH IPS['fields'] = COUNT diff --git a/settings.ini.back b/settings.ini.back index 299e0ff..2c4e443 100644 --- a/settings.ini.back +++ b/settings.ini.back @@ -15,4 +15,4 @@ username = "username" password = "password" # Measurement name -measurement = some_name +measurement = geodata