Added http return code to http alerts (#5988)

This commit is contained in:
MatteoBiscosi 2021-10-21 12:13:02 +02:00
parent cc375e5b24
commit 7eb1de3420
2 changed files with 15 additions and 6 deletions

View file

@ -4627,12 +4627,20 @@ end
-- ##############################################
function addHTTPInfoToAlertDescr(msg, alert_json)
if (alert_json)
and (table.len(alert_json["http"]) > 0)
and (alert_json["http"]["protos.http.last_method"])then
msg = msg .. string.format(" [%s: %s]",
i18n("last_http_method"),
alert_json["http"]["protos.http.last_method"])
if ((alert_json)
and (table.len(alert_json["http"]) > 0)) then
if alert_json["http"]["protos.http.last_method"] then
msg = msg .. string.format(" [%s: %s]",
i18n("last_http_method"),
alert_json["http"]["protos.http.last_method"])
end
if alert_json["http"]["protos.http.last_return_code"] then
msg = msg .. string.format(" [%s: %s]",
i18n("last_http_return_code"),
alert_json["http"]["protos.http.last_return_code"])
end
end
return msg