This command is useful to anonymize log. It can anonymized accces log file and Nginx error log file from default Nginx combined format. The result is a new file whose name contains "-anon".
Optionally a map file can be set as parameter. Then the file is load and used to run. At the end, the file will be erased by a new one.
The anonymization does not change the line length:
- ip address: replaced with a valid random generate ip with the same length
- remote user: replaced with a random [a..z] string with the same length
Examples:
- logar anonymize test.log
- logar anonymize test.log.gz table
### Command archive
This command archive previous month log lines from a /var/log/nginx/ directory to single file by domain.
The optionally *-dry* parameter is useful to test the archive process without produced any target file.
Example:
- logar /var/log/nginx/ target/
- logar -dry /var/log/nginx/ target/
### Command check
This command check bad format line in log files (access or error). It is useful to detect malformed log file or test the logar parsing feature.