Fixes blacklists timeseries not correctly showing values (#8817)

This commit is contained in:
Matteo Biscosi 2024-12-09 13:28:14 +01:00
parent 027a4ebbf4
commit c214ffca9a
5 changed files with 40 additions and 14 deletions

View file

@ -65,12 +65,14 @@ function ts_dump.blacklist_update(when, verbose)
local lists = lists_utils.getCategoryLists()
for list_name, v in pairs(lists) do
if (v.status.num_hits.total > 0) then
local current_hits = v.status.num_hits.total
if (current_hits > 0) then
list_name = list_name:gsub("%s+", "_") -- replace space with underscore
ts_utils.append("blacklist:hits", {
local num_hits = lists_utils.getHitsSinceLastUpdateAndUpdate(list_name, current_hits)
ts_utils.append("blacklist_v2:hits", {
ifid = getSystemInterfaceId(),
blacklist_name = list_name,
hits = v.status.num_hits.total
hits = num_hits
}, when)
end
end