我不了解 F5 并试图阅读这些规则。如果有人可以帮助我理解它们。
以下规则是读取 HTTP 请求并(定义变量 INTRSSN?)获取节点并将其保存在持久性表中。
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 变量中。此变量将保存在持久性表中。
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}
}
}
}