mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Rework alert serialization. Change alert info format (info for all triggered alerts are now generated)
This commit is contained in:
parent
88e17d53d8
commit
d8d7330f11
9 changed files with 134 additions and 123 deletions
|
|
@ -99,12 +99,15 @@ local function formatAlertMsg(alert)
|
|||
local decoded_alert = json.decode(alert)
|
||||
if decoded_alert and decoded_alert.json then
|
||||
local json_decoded = json.decode(decoded_alert.json)
|
||||
if json_decoded and json_decoded.flow_risk_info then
|
||||
|
||||
-- Decode json (old format was string)
|
||||
if json_decoded and json_decoded.flow_risk_info and type(json_decoded.flow_risk_info) == "string" then
|
||||
json_decoded.flow_risk_info = json.decode(json_decoded.flow_risk_info)
|
||||
end
|
||||
if json_decoded and json_decoded.alert_generation and json_decoded.alert_generation.flow_risk_info then
|
||||
if json_decoded and json_decoded.alert_generation and json_decoded.alert_generation.flow_risk_info and type(json_decoded.alert_generation.flow_risk_info) == "string" then
|
||||
json_decoded.alert_generation.flow_risk_info = json.decode(json_decoded.alert_generation.flow_risk_info)
|
||||
end
|
||||
|
||||
decoded_alert.json = json_decoded
|
||||
decoded_alert.metadata = {}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue