From bcb5253bb98e2cb53835cfe6bc2f51c9aeb4dd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=BD?= Date: Mon, 26 Jun 2023 05:47:06 +0000 Subject: [PATCH] =?UTF-8?q?23.06=E5=AE=9E=E4=BD=93=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=E5=BB=BA=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CN-23.06/clickhouse/update-23.06-ck.sql | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CN发布版本更新记录/CN-23.06/clickhouse/update-23.06-ck.sql b/CN发布版本更新记录/CN-23.06/clickhouse/update-23.06-ck.sql index 72054a7..9f17b4f 100644 --- a/CN发布版本更新记录/CN-23.06/clickhouse/update-23.06-ck.sql +++ b/CN发布版本更新记录/CN-23.06/clickhouse/update-23.06-ck.sql @@ -1,4 +1,4 @@ - CREATE TABLE cyber_narrator_galaxy.cn_entity_relation_local on cluster ck_cluster +CREATE TABLE if not exists cyber_narrator_galaxy.cn_entity_relation_local on cluster ck_cluster ( app_name String, fqdn String, @@ -11,10 +11,9 @@ update_time Int64 ) ENGINE = MergeTree -ORDER BY (common_server_ip, - common_server_port, - common_app_label, - domain) +ORDER BY (ip, + fqdn, + app_name) TTL toDateTime(update_time) + toIntervalSecond(2592000), toDateTime(update_time) + toIntervalSecond(1) GROUP BY ip, fqdn, @@ -59,7 +58,7 @@ ENGINE = Distributed('ck_cluster', rand()); - CREATE TABLE cyber_narrator_galaxy.cn_dynamic_info_relation_local on cluster ck_cluster + CREATE TABLE if not exists cyber_narrator_galaxy.cn_dynamic_info_relation_local on cluster ck_cluster ( ip String, l7_protocol String, @@ -145,4 +144,3 @@ SELECT FROM cyber_narrator_galaxy.session_record_cn_local c1 where common_l4_protocol ='IPv4_TCP' OR common_server_port in(53,443) GROUP BY ip,l7_protocol,port; - \ No newline at end of file