From fdebacdaf062ebc8b3092a1b814ef26a09958d88 Mon Sep 17 00:00:00 2001 From: da Date: Fri, 2 Jun 2023 15:03:34 +0100 Subject: [PATCH] Adding extra fields to access logging Linkerd access logs are missing the origin IP address. Solved by adding in the field x_forwarded_for to access logs which has the origin ip address. Validated by compiling and deploying the modified proxy image alongside a nginx container, checking access log content for existing fields + the new field Part fixes issue #9842 Signed-off-by: Dan Ambrose --- linkerd/http-access-log/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/linkerd/http-access-log/src/lib.rs b/linkerd/http-access-log/src/lib.rs index 8a785d64fd..c0ec70d379 100644 --- a/linkerd/http-access-log/src/lib.rs +++ b/linkerd/http-access-log/src/lib.rs @@ -133,6 +133,7 @@ where processing_ns = field::Empty, user_agent = get_header(http::header::USER_AGENT), host = get_header(http::header::HOST), + x_forwarded_for = get_header(http::header::HeaderName::from_static("x-forwarded-for")) ); // The access log span is only enabled by the `tracing` subscriber if