I’m too lazy now to ask google…but

>>> import re
>>> ipaddress=re.compile("(\d+\.\d+\.\d+\.\d+)",re.DOTALL)
>>> fp=open("logfile.log","rb")
>>> newfp=open("komserver01.log.temp","wb")
>>> for line in fp:
...     for ip in ipaddress.finditer(line):
...             newip=ip.group(1)
...             bytes=re.search("(\d+)\.(\d+)\.(\d+)",newip)
...             obfus=bytes.group(1)+"."+bytes.group(2)+"."+bytes.group(3)+".xx"
...             line=line.replace(newip,obfus)
...     newfp.write(line)

looks easy and is fast…but is there a simple way to do this?

Hmpf.