This commit is contained in:
@@ -139,6 +139,8 @@ class DatabasePool:
|
||||
src_port,
|
||||
dst_port,
|
||||
length,
|
||||
raw_present,
|
||||
capture_sources,
|
||||
app_protocol,
|
||||
app_master_protocol,
|
||||
app_category,
|
||||
@@ -151,8 +153,8 @@ class DatabasePool:
|
||||
raw
|
||||
) VALUES(
|
||||
$1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,
|
||||
$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,
|
||||
$24,$25,$26,$27,$28,$29::jsonb,$30::jsonb,$31
|
||||
$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,
|
||||
$26,$27,$28,$29,$30,$31::jsonb,$32::jsonb,$33
|
||||
)
|
||||
ON CONFLICT (packet_uid) DO UPDATE SET
|
||||
ingress_if = COALESCE(EXCLUDED.ingress_if, packets.ingress_if),
|
||||
@@ -175,6 +177,16 @@ class DatabasePool:
|
||||
src_port = COALESCE(EXCLUDED.src_port, packets.src_port),
|
||||
dst_port = COALESCE(EXCLUDED.dst_port, packets.dst_port),
|
||||
length = COALESCE(EXCLUDED.length, packets.length),
|
||||
raw_present = COALESCE(EXCLUDED.raw_present, FALSE) OR COALESCE(packets.raw_present, FALSE),
|
||||
capture_sources = (
|
||||
SELECT ARRAY(
|
||||
SELECT DISTINCT source
|
||||
FROM unnest(
|
||||
COALESCE(packets.capture_sources, ARRAY[]::text[]) ||
|
||||
COALESCE(EXCLUDED.capture_sources, ARRAY[]::text[])
|
||||
) AS source
|
||||
)
|
||||
),
|
||||
app_protocol = COALESCE(EXCLUDED.app_protocol, packets.app_protocol),
|
||||
app_master_protocol = COALESCE(EXCLUDED.app_master_protocol, packets.app_master_protocol),
|
||||
app_category = COALESCE(EXCLUDED.app_category, packets.app_category),
|
||||
@@ -208,6 +220,8 @@ class DatabasePool:
|
||||
pkt_info.get("src_port"),
|
||||
pkt_info.get("dst_port"),
|
||||
pkt_info.get("length"),
|
||||
pkt_info.get("raw_present"),
|
||||
pkt_info.get("capture_sources"),
|
||||
pkt_info.get("app_protocol"),
|
||||
pkt_info.get("app_master_protocol"),
|
||||
pkt_info.get("app_category"),
|
||||
|
||||
Reference in New Issue
Block a user