2016-06-15 16 views
0

私はF5について知らず、これらのルールを読もうとしています。もし私がそれらを理解するのを助けることができれば。これらのF5 iRulesはどういう意味ですか?

以下のルールでは、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} 
    } 
} 
} 

答えて

1

HTTP_RESPONSE部分は、XML応答を読んでも、特定のタグ値を抽出し、$ INTRSSN値に入れて保存/永続レコードを更新しようとします。

基本的に、iRule全体をまとめると、HTTP本体内の特定のフィールドをマッピングして永続性を確保する方法があります(接続の間、同じバックエンドサーバーに確実に接続されます)。

関連する問題