From af87b12fa13f507a32b48dddbe234d1ce79fe5ab Mon Sep 17 00:00:00 2001 From: Phillip Kuznetsov Date: Thu, 24 Sep 2020 00:26:24 -0700 Subject: [PATCH 1/2] Asdding edge weight, color and hover info --- pxl_scripts/px/net_flow_graph/vis.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pxl_scripts/px/net_flow_graph/vis.json b/pxl_scripts/px/net_flow_graph/vis.json index 2d7a65b88f1..9ca55d322b0 100644 --- a/pxl_scripts/px/net_flow_graph/vis.json +++ b/pxl_scripts/px/net_flow_graph/vis.json @@ -56,7 +56,17 @@ "adjacencyList": { "fromColumn": "from_entity", "toColumn": "to_entity" - } + }, + "edgeWeightColumn": "bytes_sent", + "edgeColorColumn": "bytes_recv", + "edgeThresholds": { + "mediumThreshold": 2000, + "highThreshold": 5000 + }, + "edgeHoverInfo": [ + "bytes_sent", + "bytes_recv" + ] } }, { From b88cfdf28f86564bc57e9bad0200366393b005c4 Mon Sep 17 00:00:00 2001 From: Phillip Kuznetsov Date: Thu, 24 Sep 2020 00:30:31 -0700 Subject: [PATCH 2/2] Update semantics --- pxl_scripts/px/net_flow_graph/net_flow_graph.pxl | 1 + pxl_scripts/px/net_flow_graph/vis.json | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pxl_scripts/px/net_flow_graph/net_flow_graph.pxl b/pxl_scripts/px/net_flow_graph/net_flow_graph.pxl index 21f6ce4c132..af3117ed021 100644 --- a/pxl_scripts/px/net_flow_graph/net_flow_graph.pxl +++ b/pxl_scripts/px/net_flow_graph/net_flow_graph.pxl @@ -25,4 +25,5 @@ def net_flow_graph(start: str, ips: list, grouping_entity: str): df = df[df['from_entity'] != ''] # Look up the names of the remote address. df.to_entity = px.nslookup(df.remote_addr) + df.bytes_total = df.bytes_sent + df.bytes_recv return df.drop(['remote_addr']) diff --git a/pxl_scripts/px/net_flow_graph/vis.json b/pxl_scripts/px/net_flow_graph/vis.json index 9ca55d322b0..3960f8d40e9 100644 --- a/pxl_scripts/px/net_flow_graph/vis.json +++ b/pxl_scripts/px/net_flow_graph/vis.json @@ -57,13 +57,14 @@ "fromColumn": "from_entity", "toColumn": "to_entity" }, - "edgeWeightColumn": "bytes_sent", - "edgeColorColumn": "bytes_recv", + "edgeWeightColumn": "bytes_total", + "edgeColorColumn": "bytes_total", "edgeThresholds": { - "mediumThreshold": 2000, - "highThreshold": 5000 + "mediumThreshold": 50000, + "highThreshold": 500000 }, "edgeHoverInfo": [ + "bytes_total", "bytes_sent", "bytes_recv" ] @@ -83,4 +84,4 @@ } } ] -} \ No newline at end of file +}