#!/usr/bin/env python # Take an API log and replace IPs with ones from a predefined set # This tool is useful for producing sample logs preserving clients privacy. import sys IPs = [ "66.249.64.30", "50.56.142.147", "206.190.36.45", ] cnt = 0 for l in open(sys.argv[1]): ip, l = l.split(" ", 1) sys.stdout.write(IPs[cnt % len(IPs)] + " " + l) cnt += 1