Added local/remote/multicast to clickhouse ips (#6010)

This commit is contained in:
MatteoBiscosi 2021-11-22 18:03:14 +01:00
parent 2386a910db
commit d1416cf802
3 changed files with 28 additions and 1 deletions

View file

@ -1411,6 +1411,8 @@ local known_parameters = {
["srv_asn"] = validateListOfTypeInline(validateFilters(validateASN)),
["subtype"] = validateListOfTypeInline(validateFilters(validateUnquoted)),
["tot_pkts"] = validateFilters(validateNumber), --Total packtes, used by nindex query
["cli_location"] = validateFilters(validateNumber), --Local or Remote
["srv_location"] = validateFilters(validateNumber), --Local or Remote
["observation_point_id"] = validateFilters(validateNumber), --Observation point ID, used by nindex query
["probe_ip"] = validateFilters(validateHost), --Probe IP, used by nindex query
["tot_bytes"] = validateFilters(validateNumber), --Total bytes, used by nindex query

View file

@ -69,11 +69,21 @@ tag_utils.defined_tags = {
i18n_label = i18n('db_search.tags.cli_ip'),
operators = {'eq', 'neq'}
},
cli_location = {
value_type = 'location',
i18n_label = i18n('db_search.tags.cli_location'),
operators = {'eq', 'neq'}
},
srv_ip = {
value_type = 'ip',
i18n_label = i18n('db_search.tags.srv_ip'),
operators = {'eq', 'neq'}
},
srv_location = {
value_type = 'location',
i18n_label = i18n('db_search.tags.srv_location'),
operators = {'eq', 'neq'}
},
cli_name = {
value_type = 'hostname',
i18n_label = i18n('db_search.tags.cli_name'),
@ -156,6 +166,12 @@ tag_utils.defined_tags = {
},
}
tag_utils.ip_location = {
{ label = "Remote", id = 0 },
{ label = "Local", id = 1 },
{ label = "Multicast", id = 2},
}
-- ##############################################
function tag_utils.get_tag_filters_from_request()
@ -278,6 +294,8 @@ tag_utils.db_columns_to_tags = {
["DST2SRC_TCP_FLAGS"] = "dst2src_tcp_flags",
["CLIENT_NW_LATENCY_US"] = "cli_nw_latency",
["SERVER_NW_LATENCY_US"] = "srv_nw_latency",
["CLIENT_LOCATION"] = "cli_location",
["SERVER_LOCATION"] = "srv_location",
["SCORE"] = "score",
["VLAN_ID"] = "vlan_id",
@ -361,6 +379,8 @@ tag_utils.extra_db_columns = {
["vlan_id"] = "VLAN_ID",
["cli_name"] = "SRC_LABEL",
["srv_name"] = "DST_LABEL",
["cli_location"] = "CLIENT_LOCATION",
["srv_location"] = "SERVER_LOCATION",
}
tag_utils.ordering_special_columns = {
@ -489,7 +509,8 @@ local function build_datatable_js_column_ip(name, data_name, label, order)
if (]] .. name .. [[ !== undefined) {
if (]] .. name .. [[.reference !== undefined)
html_ref = ]] .. name .. [[.reference;
return `<a class='tag-filter' data-tag-key='${]] .. name .. [[.tag_key}' data-tag-value='${]] .. name .. [[.value}' title='${]] .. name .. [[.title}' href='#'>${]] .. name .. [[.label}</a> ${html_ref}`;
return `<a class='tag-filter' data-tag-key='${]] .. name .. [[.tag_key}' data-tag-value='${]] .. name .. [[.value}' title='${]] .. name .. [[.title}' href='#'>${]] .. name .. [[.label}</a> ${]] .. name .. [[.label}</a> ${]] .. name .. [[.location.label} ${html_ref}`;
}}}]] }
end