From 37357d19ebba92543f4728eb58188d33b3ae8f39 Mon Sep 17 00:00:00 2001 From: wangkuan Date: Mon, 21 Oct 2024 16:59:01 +0800 Subject: [PATCH] =?UTF-8?q?TSG-22768=20clickhouse=20dos-event=E8=A1=A8?= =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=85=B3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tsg_olap_clickhouse_ddl_24.10.sql | 16 ++++++----- .../tsg_olap_clickhouse_ddl_check_24.10.sql | 3 ++- .../tsg_olap_clickhouse_ddl_upgrade_24.10.sql | 27 +++++++++++++------ 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_24.10.sql b/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_24.10.sql index af8653a..01bda80 100644 --- a/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_24.10.sql +++ b/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_24.10.sql @@ -11,16 +11,18 @@ CREATE TABLE IF NOT EXISTS tsg_galaxy_v3.dos_event_local on cluster ck_cluster ( attack_type String, severity String, conditions String, + source_ip String, + source_country String, destination_ip String, destination_country String, source_ip_list String, source_country_list String, sessions Int64, - session_rate Int64, + session_rate Float64, packets Int64, - packet_rate Int64, + packet_rate Float64, bytes Int64, - bit_rate Int64 + bit_rate Float64 ) ENGINE = MergeTree PARTITION BY toYYYYMMDD(toDate(recv_time)) @@ -37,16 +39,18 @@ CREATE TABLE IF NOT EXISTS tsg_galaxy_v3.dos_event on cluster ck_cluster ( attack_type String, severity String, conditions String, + source_ip String, + source_country String, destination_ip String, destination_country String, source_ip_list String, source_country_list String, sessions Int64, - session_rate Int64, + session_rate Float64, packets Int64, - packet_rate Int64, + packet_rate Float64, bytes Int64, - bit_rate Int64 + bit_rate Float64 ) ENGINE =Distributed(ck_cluster,tsg_galaxy_v3,dos_event_local,rand()); diff --git a/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_check_24.10.sql b/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_check_24.10.sql index ecac32c..0e541df 100644 --- a/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_check_24.10.sql +++ b/tsg_olap/upgrade/TSG-24.10/clickhouse/tsg_olap_clickhouse_ddl_check_24.10.sql @@ -1,6 +1,6 @@ SELECT log_id, recv_time, vsys_id, assessment_date, lot_number, file_name, assessment_file, assessment_type, features, `size`, file_checksum_sha FROM tsg_galaxy_v3.assessment_event where recv_time >= toUnixTimestamp('2030-01-01 00:00:00') AND recv_time = toUnixTimestamp('2030-01-01 00:00:00') AND recv_time = toUnixTimestamp('2030-01-01 00:00:00') AND recv_time = toUnixTimestamp( SELECT log_id, recv_time, vsys_id, device_id, device_group, data_center, direction, ip_protocol, client_ip, server_ip, internal_ip, external_ip, client_country, server_country, client_asn, server_asn, server_fqdn, server_domain, app, app_category, c2s_ttl, s2c_ttl, c2s_link_id, s2c_link_id, sessions, bytes, sent_bytes, received_bytes, pkts, sent_pkts, received_pkts, asymmetric_c2s_flows, asymmetric_s2c_flows, c2s_fragments, s2c_fragments, c2s_tcp_lost_bytes, s2c_tcp_lost_bytes, c2s_tcp_retransmitted_pkts, s2c_tcp_retransmitted_pkts FROM tsg_galaxy_v3.traffic_sketch_metric where recv_time >= toUnixTimestamp('2030-01-01 00:00:00') AND recv_time