mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Changed confidence from string to number
This commit is contained in:
parent
0a662c1a25
commit
b40d26f2e8
6 changed files with 56 additions and 25 deletions
|
|
@ -327,24 +327,14 @@ end
|
|||
local function dt_format_l7_proto(l7_proto, record)
|
||||
|
||||
if not isEmptyString(l7_proto) then
|
||||
local json = require "dkjson"
|
||||
local title = interface.getnDPIProtoName(tonumber(l7_proto))
|
||||
local confidence = nil
|
||||
local alert_json = {}
|
||||
|
||||
if record["ALERT_JSON"] then
|
||||
alert_json = json.decode(record["ALERT_JSON"])
|
||||
end
|
||||
|
||||
if (alert_json.proto) and (alert_json.proto.confidence) and (not isEmptyString(alert_json.proto.confidence)) then
|
||||
confidence = alert_json.proto.confidence
|
||||
end
|
||||
local confidence = format_confidence_from_json(record)
|
||||
|
||||
l7_proto = {
|
||||
confidence = confidence,
|
||||
title = title,
|
||||
label = shortenString(title, 12),
|
||||
value = tonumber(l7_proto),
|
||||
label = shortenString(title, 12),
|
||||
value = tonumber(l7_proto),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue