I am trying to parse through a log file to obtain the IP addresses with >5 failed
login attempts, firstly I'm trying to get the IP addresses but there seems to be something wrong with the regular expression I think. would be good to export the addresses to another text file, does anyone have any ideas where to go from here?
Thank you.
[code=python]
#!/usr/local/bin/python
file = open(location)
for line in file:
ips = ("(\d{1,3}\.){3 }\d{1,3}") ## get IPs
print 'the ip addresses are ', ips
[/code]
login attempts, firstly I'm trying to get the IP addresses but there seems to be something wrong with the regular expression I think. would be good to export the addresses to another text file, does anyone have any ideas where to go from here?
Thank you.
[code=python]
#!/usr/local/bin/python
file = open(location)
for line in file:
ips = ("(\d{1,3}\.){3 }\d{1,3}") ## get IPs
print 'the ip addresses are ', ips
[/code]
Comment