From f52946b95c58e3d7fcf082ddb0ba350ae514b328 Mon Sep 17 00:00:00 2001 From: 尹姜谊 Date: Tue, 16 Jan 2024 19:50:02 +0800 Subject: 提取common_recv_time字段名配置 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- detection/vpnservices/hotspotvpn_serverip.py | 2 +- detection/vpnservices/ipvanishvpn_servername.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'detection') diff --git a/detection/vpnservices/hotspotvpn_serverip.py b/detection/vpnservices/hotspotvpn_serverip.py index 39aa875..e75cff3 100644 --- a/detection/vpnservices/hotspotvpn_serverip.py +++ b/detection/vpnservices/hotspotvpn_serverip.py @@ -38,7 +38,7 @@ class HotspotvpnServerip(VpnDetector): self.logger.info('Start to query hotspotvpn server ip from clickhouse database') # construct query sql - TIME_FILTER_PATTERN = "(common_recv_time > toDateTime('{$start_time}', '{$time_zone}')) AND(common_recv_time <= toDateTime('{$end_time}', '{$time_zone}'))" + TIME_FILTER_PATTERN = self.config['common']['time_filter_pattern'].replace('recv_time_columnname', self.config['common']['recv_time_columnname']) time_filter = TIME_FILTER_PATTERN.replace("{$start_time}", str(self.start_time)).replace("{$end_time}", str( self.end_time)).replace("{$time_zone}", self.time_zone) self.sql = self.sql.replace("{$db_name}", self.dbname).replace("{$table_name}", self.table_name) diff --git a/detection/vpnservices/ipvanishvpn_servername.py b/detection/vpnservices/ipvanishvpn_servername.py index 3d82074..f9f7890 100644 --- a/detection/vpnservices/ipvanishvpn_servername.py +++ b/detection/vpnservices/ipvanishvpn_servername.py @@ -39,7 +39,7 @@ class IpvanishvpnServername(VpnDetector): self.logger.info('Start to query ipvanishvpn server name from session record') # construct query sql - TIME_FILTER_PATTERN = "(common_recv_time > toDateTime('{$start_time}', '{$time_zone}')) AND(common_recv_time <= toDateTime('{$end_time}', '{$time_zone}'))" + TIME_FILTER_PATTERN = self.config['common']['time_filter_pattern'].replace('recv_time_columnname', self.config['common']['recv_time_columnname']) time_filter = TIME_FILTER_PATTERN.replace("{$start_time}", str(self.start_time)).replace("{$end_time}", str( self.end_time)).replace("{$time_zone}", self.time_zone) self.sql = self.sql.replace("{$db_name}", self.dbname).replace("{$table_name}", self.table_name) -- cgit v1.2.3