Added hostname in out data json
This commit is contained in:
parent
e5f894e606
commit
27b24e3336
2 changed files with 3 additions and 1 deletions
|
@ -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<remote_host>[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
|
||||
|
|
|
@ -15,4 +15,4 @@ username = "username"
|
|||
password = "password"
|
||||
|
||||
# Measurement name
|
||||
measurement = some_name
|
||||
measurement = geodata
|
||||
|
|
Loading…
Reference in a new issue