This commit is contained in:
zino
2025-08-18 10:05:01 +02:00
parent 5d173752ae
commit 5a1115626b

View File

@@ -1,7 +1,7 @@
# JSON log format for transfer-only lines
log_format registry_json escape=json
'{'
'"timestamp":"$time_iso8601",'
'"msec":"$msec",'
'"remote_address":"$remote_addr",'
'"remote_user":"$remote_user",'
'"request_id":"$request_id",'
@@ -16,13 +16,20 @@ log_format registry_json escape=json
'"request_time":$request_time,'
'"upstream_status":"$upstream_status",'
'"upstream_time":"$upstream_response_time",'
'"upstream_addr":"$upstream_addr",'
'"referer":"$http_referer",'
'"user_agent":"$http_user_agent",'
'"x_forwarded_for":"$http_x_forwarded_for",'
'"range":"$http_range",'
'"content_range":"$sent_http_content_range",'
'"content_length":"$sent_http_content_length",'
'"etag":"$sent_http_etag",'
'"docker_content_digest":"$sent_http_docker_content_digest",'
'"arg_digest":"$arg_digest",'
'"upstream_range":"$upstream_http_range",'
'"docker_upload_uuid":"$upstream_http_docker_upload_uuid"'
'"docker_upload_uuid":"$upstream_http_docker_upload_uuid",'
'"docker_distribution_api_version":"$docker_distribution_api_version",'
'"transfer_direction":"$transfer_direction"'
'}';
map $body_bytes_sent $has_body_bytes_sent {
@@ -60,6 +67,12 @@ map "$is_pull_transfer$is_push_transfer" $is_transfer_loggable {
~1 1;
}
map "$is_pull_transfer$is_push_transfer" $transfer_direction {
default "-";
"10" "pull";
"01" "push";
}
map $upstream_http_docker_distribution_api_version $docker_distribution_api_version {
'' 'registry/2.0';
}