Difference between revisions of "F5 log irule tcl"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
```
 
```
 
when HTTP_REQUEST {
 
when HTTP_REQUEST {
  set lb_vs_socket [IP::local_addr]:[TCP::local_port]
 
  # set url [HTTP::host]--[HTTP::uri]
 
  # set http_info HTTP Method = [HTTP::method], HTTP URI = [HTTP::uri], HTTP Path = [HTTP::path], HTTP Query = [HTTP::query], HTTP Version = [HTTP::version]
 
 
   set http_method [HTTP::method]
 
   set http_method [HTTP::method]
 
   set http_host [HTTP::host]
 
   set http_host [HTTP::host]
Line 10: Line 7:
 
   set http_query [HTTP::query]
 
   set http_query [HTTP::query]
 
   set http_version [HTTP::version]
 
   set http_version [HTTP::version]
  # set http_info "$http_method, $http_host, $http_path, $http_query"
 
  set http_info "$http_method, $http_host, $http_path"
 
 
   # set http_agent [HTTP::header value "user-agent"]
 
   # set http_agent [HTTP::header value "user-agent"]
   # set http_uri [HTTP::uri]
+
   set http_info "$http_method, $http_host, $http_path, $http_query, $http_version"
 +
  set lb_vs_socket [IP::local_addr]:[TCP::local_port]
 
    
 
    
 +
  # set client [IP::client_addr]:[TCP::client_port]
 +
  # log local0.debug "$client->$lb_vs_socket, $http_info"
 
}
 
}
  
Line 21: Line 19:
 
   set benode [IP::server_addr]:[TCP::server_port]
 
   set benode [IP::server_addr]:[TCP::server_port]
 
   set benodeResp [HTTP::status]
 
   set benodeResp [HTTP::status]
  # log local0.debug "Client: $client -> VServer: $lb_vs_socket -> BENode:$node RSP:$nodeResp, HTTP_Request:$http_info"
 
 
   log local0.debug "$client->$lb_vs_socket->$benode, $benodeResp, $http_info"
 
   log local0.debug "$client->$lb_vs_socket->$benode, $benodeResp, $http_info"
 
}
 
}
Line 27: Line 24:
 
# https://my.f5.com/manage/s/article/K42210592
 
# https://my.f5.com/manage/s/article/K42210592
 
```
 
```
 +
 +
Add to irule Virtual Server Resource irule list
  
 
# Other HSL Remote
 
# Other HSL Remote
h- ttps://my.f5.com/manage/s/article/K00847516
+
- https://my.f5.com/manage/s/article/K55131641
 +
- https://my.f5.com/manage/s/article/K00847516
 
- https://my.f5.com/manage/s/article/K13080
 
- https://my.f5.com/manage/s/article/K13080
 +
- nhttps://techdocs.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/bigip-external-monitoring-implementations-12-0-0/3.html
 
```
 
```
 
````
 
````

Latest revision as of 18:15, 11 July 2023

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

when HTTP_REQUEST {
   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_agent [HTTP::header value "user-agent"]
   set http_info "$http_method, $http_host, $http_path, $http_query, $http_version"
   set lb_vs_socket [IP::local_addr]:[TCP::local_port]

   # set client [IP::client_addr]:[TCP::client_port]
   # log local0.debug "$client->$lb_vs_socket, $http_info"
}

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

Add to irule Virtual Server Resource irule list

Other HSL Remote