Forum Discussion
Request logging: some fields not recorded
- Jun 06, 2025
Response status is not available in the request, only in the response
If you use NCSA_COMMON in response settings you will get all the info, bothe request and response, in the Response Log
If you have a unique header you might be able to use it to combine Request and Response
you may also use irules to catch a unique value anywhere in the payload add it a temp header in HTTP_REQUEST and HTTP_RESPONSE events
then this header will be available for use in logging profile
and then remove it in HTTP_REQUEST_RELEASE and HTTP_RESPONSE_RELEASE events
or even generate a random id using irules
for example you can use this irulewhen HTTP_REQUEST { set rand_hex [format "%08X%08X%08X%08X" [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }]] HTTP::header insert "X-Request-ID" $rand_hex } when HTTP_REQUEST_RELEASE { HTTP::header remove "X-Request-ID" } when HTTP_RESPONSE { HTTP::header insert "X-Request-ID" $rand_hex } when HTTP_RESPONSE_RELEASE { HTTP::header remove "X-Request-ID" }
and then user X-Request-ID in logging profile
Response status is not available in the request, only in the response
If you use NCSA_COMMON in response settings you will get all the info, bothe request and response, in the Response Log
If you have a unique header you might be able to use it to combine Request and Response
you may also use irules to catch a unique value anywhere in the payload add it a temp header in HTTP_REQUEST and HTTP_RESPONSE events
then this header will be available for use in logging profile
and then remove it in HTTP_REQUEST_RELEASE and HTTP_RESPONSE_RELEASE events
or even generate a random id using irules
for example you can use this irule
when HTTP_REQUEST
{
set rand_hex [format "%08X%08X%08X%08X" [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }] [expr { int(rand() * 0xFFFFFFFF) }]]
HTTP::header insert "X-Request-ID" $rand_hex
}
when HTTP_REQUEST_RELEASE
{
HTTP::header remove "X-Request-ID"
}
when HTTP_RESPONSE
{
HTTP::header insert "X-Request-ID" $rand_hex
}
when HTTP_RESPONSE_RELEASE
{
HTTP::header remove "X-Request-ID"
}
and then user X-Request-ID in logging profile
Thank you. Worked like a charm!
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com