Natenoms Wiki

Weil Teilen Spaß macht :)

User Tools

Site Tools


Translations of this page:



Anonymizing Minecraft Log files

Log and chat will be anonymized…

These scripts run on all of our Minecraft servers to save the privacy of its users.

Bukkit standard server

sed -i -r -e s/"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"/ANONIP/g -e s/'\[INFO\] <§.*'/ANONCHAT/g /home/bukkitserver0/server.log

Bukkit in conjunction with ChatManager

ChatManager is part of PermissionsEx and if the messageformat is:

message-format: '(%H:%i:%s) %prefix%player%suffix: &3%message'

Then your replacement code is:

sed -r -e 's/\[INFO\] \([0-9]{2}\:[0-9]{2}\:[0-9]{2}\).*/ANONCHAT/g'

The replaced logfile looks like the following after the command was executed:

2011-07-02 00:56:27 [INFO] Natenom [/ANONIP:34808] logged in with entity id 518 at ([world] -140.3125, 70.0, -554.0)
2011-07-02 00:56:30 [INFO] palasto [/ANONIP:1853] logged in with entity id 527 at ([world] -10.05196491390494, 55.0, -605.7705015681518)
2011-07-02 00:56:34 ANONCHAT
2011-07-02 00:56:39 ANONCHAT

For our server

Also xAuth needs to be filtered:

sed -i -r -e s/"[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"/ANONIP/g -e 's/\[INFO\] \([0-9]{2}\:[0-9]{2}\:[0-9]{2}\).*/ANONCHAT/g' -e 's#/login.*#ANONLOGIN#g' -e 's#/changepw.*#ANONCHANGEPW#g' /home/bukkitserver0/server.log
en/minecraft/logs_anonymisieren.txt · Last modified: 2020/06/01 23:14 (external edit)