aboutsummaryrefslogtreecommitdiff
path: root/fake-ip.py
blob: 3d48771612b1bef2e017b9a736d7b2792f398bfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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