Forum Discussion

Deee-blue_14536's avatar
Deee-blue_14536
Icon for Nimbostratus rankNimbostratus
Sep 08, 2015
Solved

Request logging IRule blocking connection

Hi All,

I have an IRule, not created by myself, which works in one enviornment and blocks all connections in the second environment. For the blocked session the SSL handshake is perfomred successfully and then the connection is blocked. My knowledge of IRules is basic and I'm not able to see where the fault might be so I'd appreciate it if someone might have a look and provide some idea of where the issue is or even find the fault. I'm not able to replicate the setup on the 'working' deployment as we have moved to SAN certs so we now have multiple VIPs, i.e. the client hits the front VIP, performs SSL hand shake and is then forwarded to a secondary VIP based on a forwading policy. The IRule, which is intended to logg client details, is placed on the secondary Virtual server.

 Author: xxxxxxx

 Modified By: xxxxxxxx

 Ticket : xxxxxx

 Created : xxxxxxx

 modified: xxxxxx

 Name : HTTP_xxx_Logging

 Purpose: This rule is to send syslogs to both Monities and CC using HSL. This rule is applied to the xxx virtual servers with route domain id 01

when CLIENT_ACCEPTED {
set hsl_mon [HSL::open -proto UDP -pool /Common/xxxxxxxxxxx]

 set hsl_cc [HSL::open -proto UDP -pool /LTM/xxxxxxx]

}

when HTTP_REQUEST {
    set tcp_start_time [clock seconds]
        set milli_start [clock clicks -milliseconds]
    set xfor [HTTP::header value "X-Forwarded-For"]
        set xfor [IP::remote_addr]
        set mth [HTTP::method]
    set ua [HTTP::header value "User-Agent"]
    set host [HTTP::host]
    set uri [HTTP::uri]
    set vs [LB::server]
    set ver [HTTP::version]
    set jsess [HTTP::cookie value JSESSIONID]
    set path [HTTP::path]
}

when HTTP_RESPONSE {
    set http_end_time [clock seconds]
        set elapsed_time [expr {[clock clicks -milliseconds] - $milli_start}]
    set contenttype [HTTP::header value "content-type"]
    set svr [getfield [IP::server_addr] "%" 1]
        set stat [HTTP::status]

HSL::send $hsl_cc "Status=$stat Methods=$mth XFF=$xfor UA=\"$ua\"RequestTime=[clock format $tcp_start_time -format {%d/%m/%Y %H:%M:%S %z}] ResponseTime=[clock format $http_end_time -format {%d/%m/%Y %H:%M:%S %z}] TotalTime=$elapsed_time URL=$host$uri Version=$ver JSESSIONID=$jsess Path=$path MIME=$contenttype VS=$vs APP=$svr\n"
HSL::send $hsl_mon "Status=$stat Methods=$mth XFF=$xfor UA=\"$ua\"RequestTime=[clock format $tcp_start_time -format {%d/%m/%Y %H:%M:%S %z}] ResponseTime=[clock format $http_end_time -format {%d/%m/%Y %H:%M:%S %z}] TotalTime=$elapsed_time URL=$host$uri Version=$ver JSESSIONID=$jsess Path=$path MIME=$contenttype VS=$vs APP=$svr\n"
}

13 Replies