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

Commit

Permalink
Create flowPairCheck.py
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbailey committed Aug 14, 2015
1 parent 46fd46a commit dd195bb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions flowPairCheck.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit dd195bb

Please sign in to comment.