Fixes timeseries queries not working with serialize by mac

This commit is contained in:
Matteo Biscosi 2024-03-04 07:08:36 -05:00
parent 2d3df9e60a
commit d2026ee9a8

View file

@ -138,8 +138,14 @@ function ts_data.get_timeseries(http_context)
local tmp = split(options.schema, ":")
if (serialize_by_mac) and (options.tags.mac) then
local ts_utils = require("ts_utils")
options.schema = "host:" .. tmp[2]
options.tags.host = options.tags.mac .. "_v4"
-- In case of influxdb these info are not to be added, otherwise the query won't
if ts_utils.getDriverName() == "influxdb" then
options.tags.host_ip = nil
options.tags.mac = nil
end
end
res = performQuery(options) or {}