The following warnings occurred:
Warning [2] Undefined array key "extra" - Line: 100 - File: inc/plugins/google_seo/url.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/url.php 100 errorHandler->error_callback
/inc/plugins/google_seo.php 317 require_once
/inc/class_plugins.php 38 require_once
/inc/init.php 263 pluginSystem->load
/global.php 20 require_once
/printthread.php 16 require_once
Warning [2] Undefined variable $location - Line: 1250 - File: inc/plugins/google_seo/url.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/url.php 1250 errorHandler->error_callback
/inc/plugins/google_seo/url.php 174 google_seo_url_hook
/inc/plugins/google_seo.php 317 require_once
/inc/class_plugins.php 38 require_once
/inc/init.php 263 pluginSystem->load
/global.php 20 require_once
/printthread.php 16 require_once
Warning [2] Undefined array key "oa_social_login_custom_caption" - Line: 356 - File: inc/plugins/oa_social_login.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/oa_social_login.php 356 errorHandler->error_callback
/inc/plugins/oa_social_login.php 197 oa_social_login_load_plugin
/inc/class_plugins.php 142 oa_social_login_load_plugin_hook_any
/global.php 498 pluginSystem->run_hooks
/printthread.php 16 require_once
Warning [2] Undefined variable $unreadreports - Line: 44 - File: global.php(961) : eval()'d code PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/global.php(961) : eval()'d code 44 errorHandler->error_callback
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 252 google_seo_meta_posts
/inc/plugins/google_seo/meta.php 288 google_seo_meta_thread
/inc/class_plugins.php 142 google_seo_meta_printthread
/printthread.php 210 pluginSystem->run_hooks
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 301 google_seo_meta_posts
/inc/class_plugins.php 142 google_seo_meta_printthread_post
/printthread.php 210 pluginSystem->run_hooks
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 301 google_seo_meta_posts
/inc/class_plugins.php 142 google_seo_meta_printthread_post
/printthread.php 210 pluginSystem->run_hooks
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 301 google_seo_meta_posts
/inc/class_plugins.php 142 google_seo_meta_printthread_post
/printthread.php 210 pluginSystem->run_hooks
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 301 google_seo_meta_posts
/inc/class_plugins.php 142 google_seo_meta_printthread_post
/printthread.php 210 pluginSystem->run_hooks
Warning [2] Undefined array key "button_www" - Line: 273 - File: inc/plugins/google_seo/meta.php PHP 8.3.36 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/plugins/google_seo/meta.php 273 errorHandler->error_callback
/inc/plugins/google_seo/meta.php 301 google_seo_meta_posts
/inc/class_plugins.php 142 google_seo_meta_printthread_post
/printthread.php 210 pluginSystem->run_hooks



AWS Discussion Forum
AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - Printable Version

+- AWS Discussion Forum (https://letstalkaws.com)
+-- Forum: Q & A (https://letstalkaws.com/forum-10.html)
+--- Forum: Developer Help (https://letstalkaws.com/forum-24.html)
+--- Thread: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* (/thread-75.html)



AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - Jyotheesh_K - 24-08-2022

Trying to fetch header values from request using Access logging Variables($context.requestOverride.header.*) provided by AWS for an API Gateway. This Particular value is not Logging in CloudWatch.Please find attached document.

Please let me know if I need to do anything further.


Thanks & Regards
Jyotheesh K


RE: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - fzs - 24-08-2022

(24-08-2022, 10:33 AM)Jyotheesh_K Wrote: Trying to fetch header values from request using Access logging Variables($context.requestOverride.header.*) provided by AWS for an API Gateway. This Particular value is not Logging in CloudWatch.Please find attached document.

Is the requestOverride context variable actually setup in the body mapping templates for API GW? As in are you actually seeing this come through in the request/response but just not logging to CW?

Also, better to attach the screenshots directly in your post than adding as a document. The forum supports inline images.


RE: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - Jyotheesh_K - 26-08-2022

Hi,
Thanks for your response. 
To be more clear on this, I have two queries

1.We have TransactionID header coming in the request and it needs to be logged in cloud watch. Could you please guide me to achieve this use case.

2.We have a requirement to capture the time taken by APIGW for the transaction. could you please assist me in achieving this use case.


Regards,
Jyotheesh K


RE: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - fzs - 26-08-2022

(26-08-2022, 07:41 AM)Jyotheesh_K Wrote: 1.We have TransactionID header coming in the request and it needs to be logged in cloud watch. Could you please guide me to achieve this use case.

2.We have a requirement to capture the time taken by APIGW for the transaction. could you please assist me in achieving this use case.

As mentioned in the forum posting guildelines, you will have to tell us what all has already been setup/tried by you to achieve this as it involves multiple steps including specifying the right $context variables, log formats, log groups etc. Also, without any information on the request template format that is coming through to API GW or whether it's an HTTP or REST request, it's impossible to say how to log it. Please provide the details on what's already setup.

For HTTP requests, there are the variables that can be logged to cloudwatch: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html


RE: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - Jyotheesh_K - 26-08-2022

I have created a Rest APIGW and created a log group in Cloud Watch and configured a logs in log format. 

Now, making a get call to APIGW. In headers I am sending TransactionID. How to capture this header in Logs. Please find below attached screenshot.

   

I am able to capture rest of the logs. Is there any context variable to extract headers in log format?


RE: AWS CLOUDWATCH LOGS_$context.requestOverride.header.* - fzs - 27-08-2022

(26-08-2022, 01:51 PM)Jyotheesh_K Wrote: I have created a Rest APIGW and created a log group in Cloud Watch and configured a logs in log format. 

Now, making a get call to APIGW. In headers I am sending TransactionID. How to capture this header in Logs. Please find below attached screenshot.

I am able to capture rest of the logs. Is there any context variable to extract headers in log format?


From what I know, the standard API logs wont capture custom header variables. As shown on this link, only a set of predefined headers or other context variables are available for logging in the standard API logs. To actually get the header, you have a couple of options.

1. If you have already enabled custom logging to cloudwatch, make sure the "Log the full request/response data" is checked in the API Stage Log/Trace. Warning: This will generate over 20-40 lines of logs for each request, so consider your logging cost when enabling this.

2. Use lambda proxy-intergration to pass this header variable to lambda to then log it into cloudwatch, which can be achieved by using custom request body mapping templates in API GW.

I would also recommend reading this blog post for a more detailed explanation.