From 5a1115626b82f68b999582756e893d7af0fba9cf Mon Sep 17 00:00:00 2001 From: zino Date: Mon, 18 Aug 2025 10:05:01 +0200 Subject: [PATCH] m --- .../snippets/registry-transfer-logging.conf | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/volumes/snippets/registry-transfer-logging.conf b/volumes/snippets/registry-transfer-logging.conf index 9018a9f..71f31b6 100644 --- a/volumes/snippets/registry-transfer-logging.conf +++ b/volumes/snippets/registry-transfer-logging.conf @@ -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'; -} +} \ No newline at end of file