Fix columns type conversion for flow alerts view

This commit is contained in:
Alfredo Cardigliano 2022-05-09 18:42:03 +02:00
parent 8651e089a1
commit 103ffcf370
2 changed files with 20 additions and 0 deletions

View file

@ -17,6 +17,22 @@ local historical_flow_utils = {}
-- #####################################
function historical_flow_utils.fixWhereTypes(query)
local result = query
local flow_columns = historical_flow_utils.get_flow_columns()
for column, info in pairs(flow_columns) do
if info.where_func then
result = result:gsub(column .. "=", column .. "=" .. info.where_func)
result = result:gsub(column .. "!=", column .. "!=" .. info.where_func)
end
end
return result
end
-- #####################################
-- Converting l4_proto and l7proto to their IDs
function historical_flow_utils.parse_asn(asn)
if not isEmptyString(asn) then