Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit dd195bb

Browse files
committed
Create flowPairCheck.py
1 parent 46fd46a commit dd195bb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

flowPairCheck.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pandas as pd
2+
import numpy as np
3+
4+
clientHosts = ['0.0.0.0','1.1.1.1']
5+
serverHosts = ['2.2.2.2','3.3.3.3']
6+
netflowDF = pd.read_csv('netflow.csv', sep=',')
7+
8+
get = lambda Num, clientHost, serverHost : '' if netflowDF[(netflowDF['Client Host'] == clientHost ) & (netflowDF['Server Host'] == serverHost)].empty else str(Num) + ','
9+
hosts = []
10+
11+
for clientHost in clientHosts:
12+
match = ''
13+
for index, serverHost in enumerate(serverHosts):
14+
match += get(index, clientHost, serverHost)
15+
hosts.append((serverHost,match))
16+
17+
pd.DataFrame(hosts).to_csv('out.csv')

0 commit comments

Comments
 (0)