mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Added fix for converting alerts_map with SQLite to a meaningful value
being it stored as BLOB
This commit is contained in:
parent
7bd1bc4185
commit
bbcd1d011b
2 changed files with 8 additions and 7 deletions
|
|
@ -665,7 +665,12 @@ function alert_store:select_historical(filter, fields)
|
|||
|
||||
-- TODO handle fields (e.g. add entity value to WHERE)
|
||||
|
||||
-- Select everything by defaul
|
||||
if ((fields == "*" and not(ntop.isClickHouseEnabled()))) then
|
||||
-- SQLite needs BLOB conversion to HEX
|
||||
fields = "*, hex(alerts_map) alerts_map"
|
||||
end
|
||||
|
||||
-- Select everything by default
|
||||
fields = fields or '*'
|
||||
|
||||
if not self:_valid_fields(fields) then
|
||||
|
|
|
|||
|
|
@ -39,12 +39,8 @@ interface.select(ifid)
|
|||
|
||||
-- Fetch the results
|
||||
local alerts, recordsFiltered
|
||||
if ntop.isClickHouseEnabled() then
|
||||
alerts, recordsFiltered, info = flow_alert_store:select_request(nil, "*")
|
||||
else
|
||||
-- SQLite need conversion to HEX
|
||||
alerts, recordsFiltered, info = flow_alert_store:select_request(nil, "*, hex(alerts_map) alerts_map")
|
||||
end
|
||||
|
||||
alerts, recordsFiltered, info = flow_alert_store:select_request(nil, "*")
|
||||
|
||||
for _, _value in ipairs(alerts or {}) do
|
||||
res[#res + 1] = flow_alert_store:format_record(_value, no_html)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue