mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
Check to make sure that column variables exist in table before grabbing data
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -77,9 +77,10 @@ class CSVtoInflux():
|
|||||||
date = row[columns['Date']]
|
date = row[columns['Date']]
|
||||||
date = datetime.datetime.utcfromtimestamp(int(date) / 1000).isoformat() #convert to datetime so influx can read it, this is required
|
date = datetime.datetime.utcfromtimestamp(int(date) / 1000).isoformat() #convert to datetime so influx can read it, this is required
|
||||||
for variable in csv_variables:
|
for variable in csv_variables:
|
||||||
index = columns[variable]
|
if variable in columns.keys():
|
||||||
influx_variable = csv_vs_influx[variable]
|
index = columns[variable]
|
||||||
tags[influx_variable] = row[index]
|
influx_variable = csv_vs_influx[variable]
|
||||||
|
tags[influx_variable] = row[index]
|
||||||
self.influxdb.post_to_influx(short_description, numeric_score, tags, date)
|
self.influxdb.post_to_influx(short_description, numeric_score, tags, date)
|
||||||
|
|
||||||
def script_name(self):
|
def script_name(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user