From dd195bb66432744affc94dffd343e3451ce7b708 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 14 Aug 2015 16:47:10 -0700 Subject: [PATCH] Create flowPairCheck.py --- flowPairCheck.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 flowPairCheck.py diff --git a/flowPairCheck.py b/flowPairCheck.py new file mode 100644 index 0000000..0de21f9 --- /dev/null +++ b/flowPairCheck.py @@ -0,0 +1,17 @@ +import pandas as pd +import numpy as np + +clientHosts = ['0.0.0.0','1.1.1.1'] +serverHosts = ['2.2.2.2','3.3.3.3'] +netflowDF = pd.read_csv('netflow.csv', sep=',') + +get = lambda Num, clientHost, serverHost : '' if netflowDF[(netflowDF['Client Host'] == clientHost ) & (netflowDF['Server Host'] == serverHost)].empty else str(Num) + ',' +hosts = [] + +for clientHost in clientHosts: + match = '' + for index, serverHost in enumerate(serverHosts): + match += get(index, clientHost, serverHost) + hosts.append((serverHost,match)) + +pd.DataFrame(hosts).to_csv('out.csv')