F5 log irule tcl

From UVOO Tech Wiki
Revision as of 01:18, 11 July 2023 by Busk (talk | contribs)
Jump to navigation Jump to search

https://my.f5.com/manage/s/article/K42210592

when HTTP_REQUEST {
   set lb_vs_socket [IP::local_addr]:[TCP::local_port]
   set http_method [HTTP::method]
   set http_host [HTTP::host]
   set http_path [HTTP::path]
   set http_query [HTTP::query]
   set http_version [HTTP::version]
   set http_info "$http_method, $http_host, $http_path"
   set client [IP::client_addr]:[TCP::client_port]
   log local0.debug "$client->$lb_vs_socket, $http_info"
   # set http_info "$http_method, $http_host, $http_path, $http_query"
   # set http_agent [HTTP::header value "user-agent"]
   # set http_uri [HTTP::uri]

}

when HTTP_RESPONSE {
   set client [IP::client_addr]:[TCP::client_port]
   set benode [IP::server_addr]:[TCP::server_port]
   set benodeResp [HTTP::status]
   log local0.debug "$client->$lb_vs_socket->$benode, $benodeResp, $http_info"
}
# https://clouddocs.f5.com/api/irules/LogHttpTcpUdpToSyslogng.html
# https://my.f5.com/manage/s/article/K42210592

Other HSL Remote