Add TCP flow connection state (#8210)

* Add TCP flow connection state (#8140)

* Add Major and Minor connection states (#8140)

* Remove ZMQ connection state parsing. (#8140)

* Update doc with major and minor conn states. (#8140)
This commit is contained in:
Nicolò Maio 2024-02-28 14:45:49 +01:00 committed by GitHub
parent 03ad53f256
commit 2d150103b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 369 additions and 5 deletions

View file

@ -640,6 +640,31 @@ end
-- #####################################
local function dt_format_connection_state(id, major)
local i18n_conn_states = "flow_fields_description.minor_connection_states"
if (major) then
i18n_conn_states = "flow_fields_description.major_connection_states"
end
local name = ternary(tonumber(id) == 0, "", i18n(string.format("%s.%u",i18n_conn_states,id)))
local conn_state_tag = {
value = id,
label = name,
title = name
}
return conn_state_tag
end
local function dt_format_major_connection_state(id)
return dt_format_connection_state(id, true --[[ major ]])
end
local function dt_format_minor_connection_state(id)
return dt_format_connection_state(id, false --[[ is minor ]])
end
-- #####################################
local function dt_format_country(id)
local country_code = interface.convertCountryU162Code(id)
local label = ""
@ -1033,6 +1058,8 @@ local flow_columns = {
['DST_PROC_NAME'] = { tag = "srv_proc_name", db_type = "String", db_raw_type = "String" },
['SRC_PROC_USER_NAME'] = { tag = "cli_user_name", db_type = "String", db_raw_type = "String" },
['DST_PROC_USER_NAME'] = { tag = "srv_user_name", db_type = "String", db_raw_type = "String" },
['MAJOR_CONNECTION_STATE'] = { tag = "major_connection_state", dt_func = dt_format_major_connection_state, db_type = "Number", db_raw_type = "Uint8" },
['MINOR_CONNECTION_STATE'] = { tag = "minor_connection_state", dt_func = dt_format_minor_connection_state, db_type = "Number", db_raw_type = "Uint8" },
--[[ TODO: this column is for the aggregated_flow_columns but the parsing Function
only parses these columns, so a new logic to parse only the aggregated_flow_columns