diff --git a/scripts/historical/tables/conversations.json b/scripts/historical/tables/conversations.json index 1a6dcc2f9c..94e86ab8f6 100644 --- a/scripts/historical/tables/conversations.json +++ b/scripts/historical/tables/conversations.json @@ -5,12 +5,12 @@ "show_in_page" : "overview", "hourly": true, "chart" : [{ - "chart_id" : "conversations", - "chart_type" : "topk-timeseries", + "chart_id" : "conversations", + "chart_type" : "topk-timeseries", "unit_measure": "bytes", - "params" : { - "count" : "TOTAL_BYTES" - } + "params" : { + "count" : "TOTAL_BYTES" + } }], "visualization_type" : "table", "select" : { @@ -82,7 +82,7 @@ "sortby" : { "items" : [ { - "name" : "count", + "name" : "total_bytes", "order" : "DESC" } ] diff --git a/scripts/historical/tables/l7_contacts.json b/scripts/historical/tables/l7_contacts.json index 22bf2e733b..b1541cbe67 100644 --- a/scripts/historical/tables/l7_contacts.json +++ b/scripts/historical/tables/l7_contacts.json @@ -6,11 +6,10 @@ "hourly": true, "chart" : [{ "chart_id" : "l7_contacts", - "chart_type" : "histogram", + "chart_type" : "topk-timeseries", + "unit_measure": "bytes", "params" : { "count" : "TOTAL_BYTES", - "groupby" : "L7_PROTO", - "limit" : 10 } }], "visualization_type" : "table", @@ -101,7 +100,7 @@ "sortby" : { "items" : [ { - "name" : "count", + "name" : "total_bytes", "order" : "DESC" } ] diff --git a/scripts/historical/tables/server_contacts.json b/scripts/historical/tables/server_contacts.json index a24a55d441..faa187d04b 100644 --- a/scripts/historical/tables/server_contacts.json +++ b/scripts/historical/tables/server_contacts.json @@ -95,7 +95,7 @@ "sortby" : { "items" : [ { - "name" : "count", + "name" : "total_bytes", "order" : "DESC" } ] diff --git a/scripts/lua/modules/historical_flow_utils.lua b/scripts/lua/modules/historical_flow_utils.lua index fbe746fc6d..9343337be3 100644 --- a/scripts/lua/modules/historical_flow_utils.lua +++ b/scripts/lua/modules/historical_flow_utils.lua @@ -1047,40 +1047,40 @@ local flow_columns = { ['USER_LABEL_TSTAMP'] = { tag = "user_label_tstamp" }, } local aggregated_flow_columns = { - ['FLOW_ID'] = { tag = "rowid" }, - ['IP_PROTOCOL_VERSION'] = {}, - ['FIRST_SEEN'] = { tag = "first_seen", dt_func = dt_format_time_with_highlight }, - ['LAST_SEEN'] = { tag = "last_seen", dt_func = dt_format_time }, - ['VLAN_ID'] = { tag = "vlan_id", dt_func = dt_format_vlan }, - ['PACKETS'] = { tag = "packets", dt_func = dt_format_pkts }, - ['TOTAL_BYTES'] = { tag = "bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize" }, - ['SRC2DST_BYTES'] = { tag = "src2dst_bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize" }, - ['DST2SRC_BYTES'] = { tag = "dst2src_bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize" }, - ['PROTOCOL'] = { tag = "l4proto", dt_func = dt_format_l4_proto, simple_dt_func = l4_proto_to_string }, - ['IPV4_SRC_ADDR'] = { tag = "cli_ip", dt_func = dt_format_src_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip }, - ['IPV6_SRC_ADDR'] = { tag = "cli_ip", dt_func = dt_format_src_ip, select_func = "IPv6NumToString", where_func = "IPv6StringToNum", simple_dt_func = simple_format_src_ip }, - ['IPV4_DST_ADDR'] = { tag = "srv_ip", dt_func = dt_format_dst_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_dst_ip }, - ['IPV6_DST_ADDR'] = { tag = "srv_ip", dt_func = dt_format_dst_ip, select_func = "IPv6NumToString", where_func = "IPv6StringToNum", simple_dt_func = simple_format_dst_ip }, - ['IP_DST_PORT'] = { tag = "srv_port", dt_func = dt_format_port }, - ['L7_PROTO'] = { tag = "l7proto", dt_func = dt_format_l7_proto, simple_dt_func = interface.getnDPIProtoName }, - ['NTOPNG_INSTANCE_NAME'] = {}, - ['SCORE'] = { tag = "score", dt_func = dt_format_score, format_func = format_flow_score, i18n = i18n("score"), order = 9 }, + ['FLOW_ID'] = { tag = "rowid", db_type = "Number", db_raw_type = "Uint64" }, + ['IP_PROTOCOL_VERSION'] = { db_type = "Number", db_raw_type = "Uint8" }, + ['FIRST_SEEN'] = { tag = "first_seen", dt_func = dt_format_time_with_highlight, db_type = "DateTime", db_raw_type = "DateTime" }, + ['LAST_SEEN'] = { tag = "last_seen", dt_func = dt_format_time, db_type = "DateTime", db_raw_type = "DateTime" }, + ['VLAN_ID'] = { tag = "vlan_id", dt_func = dt_format_vlan, db_type = "Number", db_raw_type = "Uint16" }, + ['PACKETS'] = { tag = "packets", dt_func = dt_format_pkts, db_type = "Number", db_raw_type = "Uint32" }, + ['TOTAL_BYTES'] = { tag = "bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize", db_type = "Number", db_raw_type = "Uint64" }, + ['SRC2DST_BYTES'] = { tag = "src2dst_bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize", db_type = "Number", db_raw_type = "Uint64" }, + ['DST2SRC_BYTES'] = { tag = "dst2src_bytes", dt_func = dt_format_bytes, js_chart_func = "bytesToSize", db_type = "Number", db_raw_type = "Uint64" }, + ['PROTOCOL'] = { tag = "l4proto", dt_func = dt_format_l4_proto, simple_dt_func = l4_proto_to_string, db_type = "Number", db_raw_type = "Uint8" }, + ['IPV4_SRC_ADDR'] = { tag = "cli_ip", dt_func = dt_format_src_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip, db_type = "Number", db_raw_type = "Uint32" }, + ['IPV6_SRC_ADDR'] = { tag = "cli_ip", dt_func = dt_format_src_ip, select_func = "IPv6NumToString", where_func = "IPv6StringToNum", simple_dt_func = simple_format_src_ip, db_type = "IPv6", db_raw_type = "IPv6" }, + ['IPV4_DST_ADDR'] = { tag = "srv_ip", dt_func = dt_format_dst_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_dst_ip, db_type = "Number", db_raw_type = "Uint32" }, + ['IPV6_DST_ADDR'] = { tag = "srv_ip", dt_func = dt_format_dst_ip, select_func = "IPv6NumToString", where_func = "IPv6StringToNum", simple_dt_func = simple_format_dst_ip, db_type = "IPv6", db_raw_type = "IPv6" }, + ['IP_DST_PORT'] = { tag = "srv_port", dt_func = dt_format_port, db_type = "Number", db_raw_type = "Uint16" }, + ['L7_PROTO'] = { tag = "l7proto", dt_func = dt_format_l7_proto, simple_dt_func = interface.getnDPIProtoName, db_type = "Number", db_raw_type = "Uint16" }, + ['NTOPNG_INSTANCE_NAME'] = { db_type = "String", db_raw_type = "String" }, + ['SCORE'] = { tag = "score", dt_func = dt_format_score, format_func = format_flow_score, i18n = i18n("score"), order = 9, db_type = "Number", db_raw_type = "Uint16" }, ['L7_PROTO_MASTER'] = { tag = "l7proto_master", dt_func = dt_format_l7_proto, simple_dt_func = interface.getnDPIProtoName }, ['NUM_FLOWS'] = { tag = "flows_number", dt_func = dt_format_high_number }, - ['FLOW_RISK'] = { tag = "flow_risk", dt_func = dt_format_flow_risk }, - ['SRC_LABEL'] = { tag = "cli_name" }, - ['DST_LABEL'] = { tag = "srv_name" }, - ['SRC_MAC'] = { tag = "cli_mac", dt_func = dt_format_mac }, - ['DST_MAC'] = { tag = "srv_mac", dt_func = dt_format_mac }, - ['PROBE_IP'] = { tag = "probe_ip", dt_func = dt_format_probe, select_func = "IPv4NumToString", where_func = "IPv4StringToNum" }, - ['SRC_COUNTRY_CODE'] = { tag = "cli_country", dt_func = dt_format_country }, - ['DST_COUNTRY_CODE'] = { tag = "srv_country", dt_func = dt_format_country }, - ['SRC_ASN'] = { tag = "cli_asn", simple_dt_func = simple_format_src_asn }, - ['DST_ASN'] = { tag = "srv_asn", simple_dt_func = simple_format_dst_asn }, - ['INPUT_SNMP'] = { tag = "input_snmp", dt_func = dt_format_snmp_interface }, - ['OUTPUT_SNMP'] = { tag = "output_snmp", dt_func = dt_format_snmp_interface }, - ['SRC_NETWORK_ID'] = { tag = "cli_network", dt_func = dt_format_network }, - ['DST_NETWORK_ID'] = { tag = "srv_network", dt_func = dt_format_network }, + ['FLOW_RISK'] = { tag = "flow_risk", dt_func = dt_format_flow_risk, db_type = "Number", db_raw_type = "Uint64" }, + ['SRC_LABEL'] = { tag = "cli_name", db_type = "String", db_raw_type = "String" }, + ['DST_LABEL'] = { tag = "srv_name", db_type = "String", db_raw_type = "String" }, + ['SRC_MAC'] = { tag = "cli_mac", dt_func = dt_format_mac, db_type = "Number", db_raw_type = "Uint64" }, + ['DST_MAC'] = { tag = "srv_mac", dt_func = dt_format_mac, db_type = "Number", db_raw_type = "Uint64" }, + ['PROBE_IP'] = { tag = "probe_ip", dt_func = dt_format_probe, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", db_type = "Number", db_raw_type = "Uint32" }, + ['SRC_COUNTRY_CODE'] = { tag = "cli_country", dt_func = dt_format_country, db_type = "Number", db_raw_type = "Uint16" }, + ['DST_COUNTRY_CODE'] = { tag = "srv_country", dt_func = dt_format_country, db_type = "Number", db_raw_type = "Uint16" }, + ['SRC_ASN'] = { tag = "cli_asn", simple_dt_func = simple_format_src_asn, db_type = "Number", db_raw_type = "Uint32" }, + ['DST_ASN'] = { tag = "srv_asn", simple_dt_func = simple_format_dst_asn, db_type = "Number", db_raw_type = "Uint32" }, + ['INPUT_SNMP'] = { tag = "input_snmp", dt_func = dt_format_snmp_interface, db_type = "Number", db_raw_type = "Uint32" }, + ['OUTPUT_SNMP'] = { tag = "output_snmp", dt_func = dt_format_snmp_interface, db_type = "Number", db_raw_type = "Uint32" }, + ['SRC_NETWORK_ID'] = { tag = "cli_network", dt_func = dt_format_network, db_type = "Number", db_raw_type = "Uint16" }, + ['DST_NETWORK_ID'] = { tag = "srv_network", dt_func = dt_format_network, db_type = "Number", db_raw_type = "Uint16" }, } -- Extra columns (e.g. result of SQL functions)