DataScript: avi.http.get_request_id

DataScript

Function avi.http.get_request_id()
Description To get the request id for a request
Events HTTP_REQ
HTTP_RESP
Parameter No parameter
Returns A string value of the request ID (XXXX-XXXX-XXXX, the length is not fixed)
Version 18.2.3+
Example 1. Add request id to application log:

id=avi.http.get_request_id()
avi.vs.log(id)
After sending a request, the request id can be found in the application log:

DataScript Log: [string "vs-1"]:2: 1Vt-RoC2-m5O6
2. Add request id to header:
id=avi.http.get_request_id()
avi.http.add_header("Request ID", id)
After sending a request, the request id can be found in the header:

Request ID: gQJ-0MYI-YZi6

Note: This API is not supported in the events SSL_PRECONNECT, SSL_CLIENTHELLO, and SSL_HANDSHAKE_DONE.