Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

How to log traffic containing a correlation ID in the header

Our app team sends request from their web servers that contains a correlation ID, we are trying to track down some errors and they are wanting to see that the request actually makes it to the API.

Is there an iRule that I can create that would log these correlation ids so we can see that the request is making it through the F5's in Azure? I have found an iRule here that logs HTTP headers but I need to adjust it I gather to include "correlation id"

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

What exactly is the name of the "correlation id" header, and what other info do you need to log?

0
Comments on this Answer
Comment made 1 week ago by crowe 1

We need all information related to any traffic that has any correlation id attached. I used the below iRule to catch all HTTP headers today but we did not see any of the random ID's that our system attaches to the headers.

Once a customer is assigned a correlation ID, that same ID stays with them during their entire transaction. Below is the iRUle I tried:

when HTTP_REQUEST { set LogString "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]" log local0. "=============================================" log local0. "$LogString (request)" foreach aHeader [HTTP::header names] { log local0. "$aHeader: [HTTP::header value $aHeader]" } log local0. "=============================================" } when HTTP_RESPONSE { log local0. "=============================================" log local0. "$LogString (response) - status: [HTTP::status]" foreach aHeader [HTTP::header names] { log local0. "$aHeader: [HTTP::header value $aHeader]" } log local0. "============================================="

}

THANK YOU IN ADVANCE!

0
Comment made 1 week ago by Jie 2722

How is the "correlation id" set and transported? In an HTTP header by itself or in a cookie?

Can the app people provide a sample of the session from the browser with the developer mode turned on?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Thanks for your reply, I’m waiting on a response from the team because I found an iRule to log all header traffic which should be sufficient.

They did advise it is various ID’s. I’ll add an update Monday with more specifics of what I already showed the isn’t enough.

0
Comments on this Answer
Comment made 1 week ago by crowe 1

It is set in an HTTP header by itself. The API generates one for each transaction and puts it in the chipotle-correlationid header.

0