Added missed GEOIPDB var into influxdb2 parsing config func

This commit is contained in:
Alexey Nizhegolenko 2022-07-21 17:42:51 +03:00
parent 8918b173ac
commit 056b37af2a

View file

@ -5,6 +5,7 @@
# geoip, which is going away r.s.n. # geoip, which is going away r.s.n.
# Added possibility of processing more than one Nginx log file, # Added possibility of processing more than one Nginx log file,
# by adding threading support. 2022 July by Alexey Nizhegolenko # by adding threading support. 2022 July by Alexey Nizhegolenko
# Added InfluxDB 2 support. 2022/07/21 by Alexey Nizhegolenko
import os import os
import re import re
@ -130,7 +131,6 @@ def main():
MEASUREMENT = CONFIG.get('INFLUXDB2', 'measurement') MEASUREMENT = CONFIG.get('INFLUXDB2', 'measurement')
INFLUXDBORG = CONFIG.get('INFLUXDB2', 'organization') INFLUXDBORG = CONFIG.get('INFLUXDB2', 'organization')
# Parsing log file and sending metrics to Influxdb # Parsing log file and sending metrics to Influxdb
while True: while True:
logs = [] logs = []
@ -164,8 +164,8 @@ def main():
# Run the main loop and grep data in separate threads # Run the main loop and grep data in separate threads
t = website t = website
if os.path.exists(log): if os.path.exists(log):
t = threading.Thread(target=logparse, kwargs={'LOGPATH': log, 'URL': URL, 'INFLUXDBTOKEN': INFLUXDBTOKEN, t = threading.Thread(target=logparse, kwargs={'GEOIPDB': GEOIPDB, 'LOGPATH': log, 'URL': URL, 'INFLUXDBTOKEN': INFLUXDBTOKEN,
'INFLUXDBBUCKET': INFLUXDBBUCKET, 'MEASUREMENT': MEASUREMENT, 'INFLUXDBBUCKET': INFLUXDBBUCKET, 'MEASUREMENT': MEASUREMENT, 'INFLUXDB_VERSION': INFLUXDB_VERSION,
'INODE': INODE, 'WEBSITE': website, 'INFLUXDBORG': INFLUXDBORG}, daemon=True, name=website) # NOQA 'INODE': INODE, 'WEBSITE': website, 'INFLUXDBORG': INFLUXDBORG}, daemon=True, name=website) # NOQA
for thread in threading.enumerate(): for thread in threading.enumerate():
thread_names.append(thread.name) thread_names.append(thread.name)