summaryrefslogtreecommitdiff
path: root/clean-log.sh
blob: bdecdffcbc3c36551eb98c18dc92b1a2e05afd94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

# Use this sed script to clean your logs before
# pasting it publicly

# Usage:
#   Replace `your_username` and `your_domain` in this script, then:
#
#     ./clean-log.sh LOGFILE

# Todo:
#  - IPs (should be already cleaned by rsyslog)
#  - Browser user agents
#  - Generate this script from leap_cli

sed -r '
# Clean all email addresses
s/((\w|[.])+)@((\w|[.])+)/<EMAIL REDACTED>/g

# Replace username
s/your_username/<USERNAME_REDACTED>/g

#Replace domain
s/your_domain/<DOMAIN_REDACTED>/g
' "$1"