From 056b37af2a5b2d4439251b7fc675d875cd830ee2 Mon Sep 17 00:00:00 2001 From: Alexey Nizhegolenko Date: Thu, 21 Jul 2022 17:42:51 +0300 Subject: [PATCH] Added missed GEOIPDB var into influxdb2 parsing config func --- geoparser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geoparser.py b/geoparser.py index 6173f30..f77b581 100755 --- a/geoparser.py +++ b/geoparser.py @@ -5,6 +5,7 @@ # geoip, which is going away r.s.n. # Added possibility of processing more than one Nginx log file, # by adding threading support. 2022 July by Alexey Nizhegolenko +# Added InfluxDB 2 support. 2022/07/21 by Alexey Nizhegolenko import os import re @@ -130,7 +131,6 @@ def main(): MEASUREMENT = CONFIG.get('INFLUXDB2', 'measurement') INFLUXDBORG = CONFIG.get('INFLUXDB2', 'organization') - # Parsing log file and sending metrics to Influxdb while True: logs = [] @@ -164,8 +164,8 @@ def main(): # Run the main loop and grep data in separate threads t = website if os.path.exists(log): - t = threading.Thread(target=logparse, kwargs={'LOGPATH': log, 'URL': URL, 'INFLUXDBTOKEN': INFLUXDBTOKEN, - 'INFLUXDBBUCKET': INFLUXDBBUCKET, 'MEASUREMENT': MEASUREMENT, + t = threading.Thread(target=logparse, kwargs={'GEOIPDB': GEOIPDB, 'LOGPATH': log, 'URL': URL, 'INFLUXDBTOKEN': INFLUXDBTOKEN, + 'INFLUXDBBUCKET': INFLUXDBBUCKET, 'MEASUREMENT': MEASUREMENT, 'INFLUXDB_VERSION': INFLUXDB_VERSION, 'INODE': INODE, 'WEBSITE': website, 'INFLUXDBORG': INFLUXDBORG}, daemon=True, name=website) # NOQA for thread in threading.enumerate(): thread_names.append(thread.name)