Select Page

Log HTTP Transaction Using iRule

by | 3-Aug-2020 | ADC, F5, LTM

Applied version

  • BIG-IP LTM
    Focus on version 15.X, 14.X
    Less focus on earlier version

*Take note of every syntax with (‘) single-quote or (“) double-quote characters, copy-paste might not work.

Log HTTP Transaction Using iRule

(1) Creating iRule for logging http transaction

You can use iRule to log the HTTP transactions passing through a Standard virtual server (VIP) with HTTP profile.

  • Timestamp for every request, and state.
  • TCP connection setup
  • BIG-IP process state
  • Summary of HTTP requests and responses (in clear text)
  • *Example use case: troubleshooting performance issue. 

 

iRule “irule_log_http_transaction”

  • iRule, line 1-30 (Figure 1)
  • iRule, line 30-59 (Figure 2)

(2) Examining the captured logs

  • Raw LTM log (Figure 1)
  • Transaction log (Figure 2)
  • tail -f /var/log/ltm
  • sed -e ‘s/^.*\(transaction\)/\1/;tx;d;:x’ /var/log/ltm > /var/tmp/log_http_transaction.txt
    • CLIENT_ACCEPTED: Client connected to Virtual Server
    • CLIENT_DATA: Payload received from client
    • HTTP_REQUEST: Complete HTTP request has been fully parsed
    • SERVER_CONNECTED: BIG-IP connected to Pool Member
    • HTTP_REQUEST_SEND: HTTP request is about to be sent to Pool Member
    • SERVER_DATA: Payload received from server
    • HTTP_RESPONSE: Complete HTTP response has been fully parsed
    • HTTP_RESPONSE_RELEASE: HTTP response is about to be sent to Client

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *