import re
# open('not_found.log','w').writelines([ line for line in open('allLogs.log') if 'not found' in line])
fname = 'allLogs.log'
with open(fname) as f:
content = f.readlines()
new = [line for line in content if 'not found' in line]
filtered = []
for line in new:
line = re.sub(r'^.*WSLog - ', '', line)
filtered.append(line)
# print(filtered)
open('not_found.log','w').writelines(set(filtered))