summaryrefslogtreecommitdiff
path: root/detection
diff options
context:
space:
mode:
author尹姜谊 <[email protected]>2024-01-16 19:50:02 +0800
committer尹姜谊 <[email protected]>2024-01-16 19:50:02 +0800
commitf52946b95c58e3d7fcf082ddb0ba350ae514b328 (patch)
tree12d757f77188e62caa0ce97ddcaa12436584ae38 /detection
parent7170fefc0b4feeb00a3968b53f198411a3511ac6 (diff)
提取common_recv_time字段名配置
Diffstat (limited to 'detection')
-rw-r--r--detection/vpnservices/hotspotvpn_serverip.py2
-rw-r--r--detection/vpnservices/ipvanishvpn_servername.py2
2 files changed, 2 insertions, 2 deletions
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)