adding custom Request Headers to Apigee NGINX access_log

Hi Team, 

I am trying to log a custom request header "X-ASGW-ID" which I am setting using Javascript which is added to Pre-proxy Flow Hook. 

context.setVariable("request.header.X-ASGW-ID",<<value>>);

 

Based on solution provided in https://www.googlecloudcommunity.com/gc/Cloud-Product-Articles/How-to-add-request-headers-to-Apigee-... , I am trying to log this custom header in the Apigee nginx access log. 

However, the value comes blank  when I tail the access_log to see the new headers get logged.

I have tried using $http_x_asgw_id as well as $upstream_http_x_asgw_id, but both gives me blank value. Can you please suggest how we can log this?

Thanks in advance!

0 2 266
2 REPLIES 2

@dchiesa1 @jghunt  @anilsagar Could you please help?

Hi @dchiesa1 ,

I am facing the exact same problem. Can you please help?