The UNIQUE_ID enviroment variable will be forwarded in the header to subsequent systems. This part can be configured in global section.
RequestHeader set X-RP-UNIQUE_ID %{UNIQUE_ID}e
On the next hop system the Header Variable must be read and logged. (see http.conf for details)
RewriteEngine On RewriteCond %{HTTP:X-RP-UNIQUE_ID} (.*) RewriteRule .* - [E=UNIQUE_ID:%1]