Logging URL redirection

I need to log the requests to some URLs that are redirected to another domain. I need to know if there’s still clients trying to access the OLD domain. I wrote an aFLEX to do this, and it works ok in my lab enviroment. I did the same configuration at the production network, but it doesn’t work. There’s not traffic matching the rule. I did a debug at the ADC (axdebug) and there’s nothing matching the aFlex.

Here’s the aFlex:

#Log HTTP request to Redirected web sites

when HTTP\_REQUEST \{

if \{([CLASS::match [string tolower [HTTP::host]] starts\_with cl-logging-redirections])\} \{

#set slogging yes

    set cs\_ip\_method\_uri "[IP::client\_addr] [HTTP::method] [HTTP::uri]"
    set site\_web [HTTP::host]
    set date\_time\_request [clock format [TIME::clock seconds] -format \{%Y-%m-%d %H:%M:%S\} ]
    set cs\_user\_agent [string map \{" " "\+"\} [HTTP::header "User-Agent"]]
    set c\_request\_version [HTTP::version]
    if \{[HTTP::header exists Referer]\} \{
     set cs\_referer [HTTP::header "Referer"]
    \} else \{ set cs\_referer "-" \}
   set redirection [HTTP::header Location]
   set log\_str "log-redirection-$site\_web $date\_time\_request $cs\_ip\_method\_uri $cs\_referer $cs\_user\_agent HTTP/$c\_request\_version $redirection"
   log local0.INFO $log\_str
\} 
\}

I need some help to find where’s the error.

Hello pinala,

aFlex are also under support so you can open a case to let the A10 TAC check where the error is.

CU hkohn!