Fixes device tag not working with timeseries

This commit is contained in:
MatteoBiscosi 2023-01-24 12:36:32 +01:00
parent 7954b0295b
commit ee36cf24f3
2 changed files with 15 additions and 1 deletions

View file

@ -1072,6 +1072,16 @@ local function validateZoom(zoom)
end
end
-- ##############################################
-- @brief Returns true if inputstr is a Mac or all string
local function validateDevice(inputstr)
return (validateDeviceOrAll(inputstr) or validateIPV4(inputstr))
end
http_lint.validateDevice = validateDevice
-- ##############################################
local function validateCategory(cat)
if starts(cat, "cat_") then
local id = split(cat, "cat_")[2]
@ -1631,7 +1641,7 @@ local known_parameters = {
["alert_generation"] = { jsonCleanup, validateJSON },
-- EXCLUDE DEVICES
["device"] = validateDeviceOrAll,
["device"] = validateDevice,
["mac_list"] = validateUnquoted,
["mac_alias"] = validateSingleWord,
["mac_status"] = validateStatus,

View file

@ -17,6 +17,8 @@ local pool = _GET["pool"]
local vlan = _GET["vlan"]
local mac = _GET["mac"]
local subnet = _GET["subnet"]
local device = _GET["device"]
local port = _GET["port"]
local res = {}
@ -36,6 +38,8 @@ local tags = {
vlan = vlan,
mac = mac,
subnet = subnet,
device = device,
port = port
}
res = table.merge(res, timeseries_info.retrieve_specific_timeseries(tags, query))