---
name: "anonip"
section: "1"
platform: "linux"
package: "anonip"
version: "1.1.0-2.1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/anonip"
---

# anonip(1)

a tool to anonymize IPv4 and IPv6 addresses in existing or via pipe created logfiles.

## NAME

anonip - a tool to anonymize IPv4 and IPv6 addresses in existing or via pipe created logfiles.

## DESCRIPTION

usage: anonip \[-h\] \[-4 INTEGER\] \[-6 INTEGER\] \[-i INTEGER\] \[-o FILE\]

-

  \[--input FILE\] \[-c INTEGER \[INTEGER ...\]\] \[-l STRING\] \[--regex STRING \[STRING ...\]\] \[-r STRING\] \[-p\] \[-d\] \[-v\]

Anonip is a tool to anonymize IP-addresses in log files.

### options:

- **-h**, **--help**

  show this help message and exit

- **-4**, **--ipv4mask** INTEGER

  truncate the last n bits (default: 12)

- **-6**, **--ipv6mask** INTEGER

  truncate the last n bits (default: 84)

- **-i**, **--increment** INTEGER

  increment the IP address by n (default: 0)

- **-o**, **--output** FILE

  file to write to

- **--input** FILE

  File or FIFO to read from (default: stdin)

- **-c**, **--column** INTEGER \[INTEGER ...\]

  assume IP address is in column n (1-based indexed; default: 1)

- **-l**, **--delimiter** STRING

  log delimiter (default: " ")

- **--regex** STRING \[STRING ...\]

  regex for detecting IP addresses (use optionally instead of **-c**)

- **-r**, **--replace** STRING

  replacement string in case address parsing fails (Example: 0.0.0.0)

- **-p**, **--skip-private**

  do not mask addresses in private ranges. See IANA Special-Purpose Address Registry.

- **-d**, **--debug**

  print debug messages

- **-v**, **--version**

  show program's version number and exit

Example-usage in apache-config: CustomLog "\| */usr/bin/anonip* \[OPTIONS\] **--output** ${APACHE\_LOG\_DIR}/access.log" combined

## AUTHORS

**anonip** was written by the Swiss Privacy Foundation, which is now part of the Digitale Gesellschaft e.V.

## SEE ALSO

Full documentation for the **anonip** tool wit several additional examples is available in /usr/shar/doc/anonip/README.md.gz
