From e49d07391bb989a8e316d43a26c01a2d34ec89cc Mon Sep 17 00:00:00 2001 From: TANGWY Date: Mon, 23 Sep 2024 09:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=92=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B8=85=E7=90=86=E8=84=9A=E6=9C=AC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BB=A5=E5=8F=8D=E6=98=A0=E5=B1=9E=E6=80=A7=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除了`interface`属性并引入了`service_name`属性。 - 在`base_dataclean_pg.py`中更新了数据聚合字段,以匹配数据库中的属性变更。 - 确保了数据清理脚本与数据库架构保持同步,并能正确处理新的属性名称。 --- sql/pg_data.sql | 4 ++-- utils/base_dataclean_pg.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/pg_data.sql b/sql/pg_data.sql index 7ae9f38..c528c44 100644 --- a/sql/pg_data.sql +++ b/sql/pg_data.sql @@ -2,6 +2,6 @@ delete from isop_diting.tb_cep_attr where attr_name = 'trojan_type'; delete from isop_diting.tb_cep_attr where attr_name = 'account'; delete from isop_diting.tb_cep_attr where attr_name = 'worm_family'; -delete from isop_diting.tb_cep_attr where attr_name = 'interface'; +delete from isop_diting.tb_cep_attr where attr_name = 'service_name'; INSERT INTO isop_diting.tb_cep_attr (attr_name, attr_type, is_system,is_common) -VALUES ('trojan_type', 'String', '1','1'),('interface', 'String','1','1'),('worm_family', 'String','1','1'),('account', 'String','1','1'); +VALUES ('trojan_type', 'String', '1','1'),('service_name', 'String','1','1'),('worm_family', 'String','1','1'),('account', 'String','1','1'); \ No newline at end of file diff --git a/utils/base_dataclean_pg.py b/utils/base_dataclean_pg.py index f1a02d7..4c69a6b 100644 --- a/utils/base_dataclean_pg.py +++ b/utils/base_dataclean_pg.py @@ -134,7 +134,7 @@ def get_interface_group_data(index,startTime,endTime,diplist): "composite": { "size": size, "sources": [ - {"interface": { "terms": {"field": "interface"} }}, + {"service_name": { "terms": {"field": "service_name"} }}, {"sip": { "terms": { "field": "sip"}}}, {"account": { "terms": { "field": "account"}}}, {"trojan_type": { "terms": { "field": "trojan_type"}}} @@ -156,7 +156,7 @@ def get_interface_group_data(index,startTime,endTime,diplist): "account": bucket['key']['account'], "count": bucket['doc_count'], "jobnum": bucket['key']['trojan_type'] , - "interface": bucket['key']['interface'] , + "interface": bucket['key']['service_name'] , "ip":bucket['key']['sip'] } datas.append(data)