Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/nginx/templates/logrotate.erb

Issue 29785567: #11294 - Generate and store anonymized HTTPd logs (Closed)
Patch Set: #11294 - Include input MD5 sum with archive file names Created June 5, 2018, 2:29 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/nginx/manifests/init.pp ('k') | modules/private-stub/hiera/base.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/nginx/templates/logrotate.erb
diff --git a/modules/nginx/templates/logrotate.erb b/modules/nginx/templates/logrotate.erb
index b957e92b2e22781ebf69ce5f3b6c22d369a1f104..b5be45fcf23947ebd74c41adabe9c99064e27482 100644
--- a/modules/nginx/templates/logrotate.erb
+++ b/modules/nginx/templates/logrotate.erb
@@ -8,5 +8,11 @@
sharedscripts
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
+ set -- <%= scope.function_shellquote([@log]) %>
+ set -- "/var/log/nginx/$1.2.gz" "/var/log/archive/$1"
+ [ ! -f "$1" ] || zcat "$1" | /usr/local/bin/anonymize-access-log \
+ --geolite2-db /usr/share/GeoIP/GeoLite2-Country.mmdb \
+ --salt <%= scope.function_shellquote([@log_salt]) %> \
+ | gzip -9 >"$2.`date +%Y-%m-%d`.`md5sum \"$1\" | cut -d' ' -f1`.gz"
endscript
}
« no previous file with comments | « modules/nginx/manifests/init.pp ('k') | modules/private-stub/hiera/base.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld