这些 F5 iRules 是什么意思?
What does these F5 iRules mean?
我不了解 F5 并试图阅读这些规则。如果有人可以帮助我理解它们。
以下规则是读取 HTTP 请求和(定义变量 INTRSSN?)获取节点并将其保存在持久性中 table。
when HTTP_REQUEST {
if { ( [HTTP::method] eq "POST") and
( [HTTP::path] equals "/webserv/Interaction") and
( [HTTP::header value "Content-Length"] < 1024 ) }{
#Debugging Purpose
#log local0. "First Request: [HTTP::uri]"
HTTP::collect [HTTP::header Content-Length]
if { [info exists "INTRSSN"] }{
set IntrExist [persist lookup uie $INTRSSN node]
#log local0. "Response check if exist $IntrExist"
if {($IntrExist != "")}{
node $IntrExist
}
}
}
}
此规则将读取 HTTP 请求并提取特定标记值并将其放入 INTRSSN 变量中。这个变量会被持久化保存table.
when HTTP_REQUEST_DATA {
if { ( [HTTP::path] equals "/webserv/Interaction") and
( [HTTP::header value "Content-Length"] < 1024 ) }{
set INTRSSN [findstr [HTTP::payload] "<soap1:sessionID>" 17 "<"]}
if { $INTRSSN != "" } {
#Debugging Purpose
#log local0. "SOAP Session ID: $INTRSSN"
catch { persist uie "$INTRSSN"}
#log local0. "Request_Data $INTRSSN"
}
}
我没看懂这个事件。
when HTTP_RESPONSE {
if { [HTTP::header "Content-Type" ] equals "text/xml" }{
set resdata [HTTP::payload]
set INTRSSN [findstr $resdata "<sessionID>" 11 "<"]
if { $INTRSSN != "" } {
#Debugging Purpose
#log local0. "Found sessionID on Response: $INTRSSN in SOAP response from: [LB::server addr]"
#log local0. "Interaction $INTRSSN"
catch {persist add uie $INTRSSN 600}
}
}
}
HTTP_RESPONSE
部分尝试读取 XML 响应并提取特定标记值,将其放入 $INTRSSN 值和 save/update 持久记录中。
基本上,整个 iRule 放在一起是一种在 HTTP 主体中映射特定字段以用于持久性的方法(确保连接在连接生命周期内转到同一后端服务器)。
我不了解 F5 并试图阅读这些规则。如果有人可以帮助我理解它们。
以下规则是读取 HTTP 请求和(定义变量 INTRSSN?)获取节点并将其保存在持久性中 table。
when HTTP_REQUEST {
if { ( [HTTP::method] eq "POST") and
( [HTTP::path] equals "/webserv/Interaction") and
( [HTTP::header value "Content-Length"] < 1024 ) }{
#Debugging Purpose
#log local0. "First Request: [HTTP::uri]"
HTTP::collect [HTTP::header Content-Length]
if { [info exists "INTRSSN"] }{
set IntrExist [persist lookup uie $INTRSSN node]
#log local0. "Response check if exist $IntrExist"
if {($IntrExist != "")}{
node $IntrExist
}
}
}
}
此规则将读取 HTTP 请求并提取特定标记值并将其放入 INTRSSN 变量中。这个变量会被持久化保存table.
when HTTP_REQUEST_DATA {
if { ( [HTTP::path] equals "/webserv/Interaction") and
( [HTTP::header value "Content-Length"] < 1024 ) }{
set INTRSSN [findstr [HTTP::payload] "<soap1:sessionID>" 17 "<"]}
if { $INTRSSN != "" } {
#Debugging Purpose
#log local0. "SOAP Session ID: $INTRSSN"
catch { persist uie "$INTRSSN"}
#log local0. "Request_Data $INTRSSN"
}
}
我没看懂这个事件。
when HTTP_RESPONSE {
if { [HTTP::header "Content-Type" ] equals "text/xml" }{
set resdata [HTTP::payload]
set INTRSSN [findstr $resdata "<sessionID>" 11 "<"]
if { $INTRSSN != "" } {
#Debugging Purpose
#log local0. "Found sessionID on Response: $INTRSSN in SOAP response from: [LB::server addr]"
#log local0. "Interaction $INTRSSN"
catch {persist add uie $INTRSSN 600}
}
}
}
HTTP_RESPONSE
部分尝试读取 XML 响应并提取特定标记值,将其放入 $INTRSSN 值和 save/update 持久记录中。
基本上,整个 iRule 放在一起是一种在 HTTP 主体中映射特定字段以用于持久性的方法(确保连接在连接生命周期内转到同一后端服务器)。