Advertisement
Guest User

Untitled

a guest
May 13th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import re
  2.  
  3. f = open("login_attempts.csv", "w")
  4. logfile = "ApacheLogFile2.log"
  5.  
  6. with open(logfile) as fp:
  7. for line in fp:
  8. loginAttempt = re.findall(r'/.*pma_username=(.*)&pma_password=(.*) HTTP\/1.1/', line)[:1]
  9. f.write(loginAttempt[0])
  10. print(loginAttempt[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement