Skip to content

Commit

Permalink
but it do
Browse files Browse the repository at this point in the history
  • Loading branch information
deveyNull committed Nov 10, 2017
1 parent 551e1ef commit 8d1f351
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions fasterPlz.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,19 @@ def is_good(row, length):
else:
return True

def is_gooder(row, length):

if len(row) <= length:
return False
#elif len(row[0]) != 17:
# return False
else:
s = str('.'.join(row[8].split(".")[-2:]))

if "#" in s or "/" in s or "=" in s or "/" in s:
return False
else:
return True

def dictionaryToArrays(magicDictionary):

Expand Down Expand Up @@ -477,18 +489,20 @@ def listMaker(csvOne):
for row in csv_f:
try:

if is_good(row, 12):
if is_gooder(row, 12):
dictKey = str('.'.join(row[8].split(".")[-2:]))

if is_number(dictKey[-1]):
b = "0"
else:
if dictKey in listOfNames:
b = "0"

else:
else:

listOfNames.append(dictKey)


if dictKey in listOfNames:
b=0


else:
listOfNames.append(dictKey)



except:
Expand All @@ -514,7 +528,7 @@ def dictionaryMaker(csvOne, targetDomain):

try:
length = 30
if is_good(row, 12):
if is_gooder(row, 12):
dictKey = str('.'.join(row[8].split(".")[-2:]))


Expand All @@ -541,10 +555,10 @@ def dictionaryMaker(csvOne, targetDomain):
return(magicDictionary)

def threadedFunction(i):
magicDictionary = dictionaryMaker("myOut.csv", i)
magicDictionary = dictionaryMaker("2017-cdx-logs/bro_http_log", i)

temp = dictionaryToArrays(magicDictionary)
with open("to.csv", "at") as f:
with open("otto.csv", "at") as f:
writer = csv.writer(f)
writer.writerow(temp)

Expand All @@ -553,7 +567,7 @@ def threadedFunction(i):

blacklist = ["usma.bluenet", "usna.bluenet", "hq.bluenet", "range.bluenet", "rmc.bluenet"]

listOfNames = listMaker("myOut.csv")
listOfNames = listMaker("2017-cdx-logs/bro_http_log")
#listOfNames = ["osha.gov"]
for name in blacklist:
listOfNames.remove(name)
Expand Down

0 comments on commit 8d1f351

Please sign in to comment.