Forum Discussion

fujisen's avatar
fujisen
Icon for Nimbostratus rankNimbostratus
Oct 19, 2011

Username persistence

hi, View client (SSO)-> APM/LTM -> server 1&2 Below Irule is creating username persistent entry only when one connect profile is enabled but not otherwise when HTTP_REQUEST { HTTP::collect [HTTP::header Content-Length] } when HTTP_REQUEST_DATA { First request when entering credentials set username [findstr [HTTP::payload] username 30 "<"] if { $username ne "" } { persist uie $username 180 log local0. "Persisting $username" } } Anyway to Keep oneconnect disabled and persist username? Thanks in advance

3 Replies

  • HTTP_REQUEST {

     

    HTTP::collect [HTTP::header Content-Length]

     

    }

     

    when HTTP_REQUEST_DATA {

     

    set username [findstr [HTTP::payload] username 30 "<"]

     

    if { $username ne "" } {

     

    persist uie $username 180

     

    log local0. "Persisting $username"

     

    }

     

    }

     

     

    show ltm persistence persist-records all-properties

     

    Sys::Persistent Connections

     

    Total records returned: 0

     

     

    Any ideas & suggestions to get this working with one connect profile disabled...

     

     

    thanks,

     

     

     

     

  • Patrick_Chang_7's avatar
    Patrick_Chang_7
    Historic F5 Account
    If oneconnect profile is not enabled, then the iRule only triggers on the first request in the connection. You could make the response HTTP1.0. This would force a new connection for every request. Or you could use a oneconnect profile with a netmask of 255.255.255.255 (which would end up with a new connection for every client IP).
  • i might be wrong but i understand without oneconnect, event is still triggered but server-side connection isn't detached.

    [root@iris:Active] config  b virtual bar list
    virtual bar {
       snat automap
       pool foofoo
       destination 172.28.17.33:http
       ip protocol tcp
       rules myrule
       profiles {
          http {}
          tcp {}
       }
    }
    [root@iris:Active] config  b pool foofoo list
    pool foofoo {
       members 10.10.70.120:http {}
    }
    [root@iris:Active] config  b rule myrule list
    rule myrule {
       when CLIENT_ACCEPTED {
            set i 0
            log local0. "i - $i|client - [IP::client_addr]:[TCP::client_port]"
    }
    
    when HTTP_REQUEST {
            log local0. "i - $i|client - [IP::client_addr]:[TCP::client_port]"
            if {$i == 0} {
                    pool foo
            }
            incr i
    }
    
    when HTTP_RESPONSE {
            log local0. "i - $i|server - [IP::remote_addr]:[TCP::remote_port]"
    }
    }
    [root@iris:Active] config  b pool foo list
    pool foo {
       members 10.10.70.110:http {}
    }
    
    [root@iris:Active] config  tail -f /var/log/ltm
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 0|client - 192.168.206.102:62984
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 0|client - 192.168.206.102:62984
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 1|server - 10.10.70.110:80
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 1|client - 192.168.206.102:62984
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 2|server - 10.10.70.110:80
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 2|client - 192.168.206.102:62984
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 3|server - 10.10.70.110:80
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 3|client - 192.168.206.102:62984
    Oct 20 20:18:29 local/tmm info tmm[4601]: Rule myrule : i - 4|server - 10.10.70.110:80
    Oct 20 20:18:39 local/tmm info tmm[4601]: Rule myrule : i - 4|client - 192.168.206.102:62984
    Oct 20 20:18:39 local/tmm info tmm[4601]: Rule myrule : i - 5|server - 10.10.70.110:80
    Oct 20 20:18:40 local/tmm info tmm[4601]: Rule myrule : i - 5|client - 192.168.206.102:62984
    Oct 20 20:18:40 local/tmm info tmm[4601]: Rule myrule : i - 6|server - 10.10.70.110:80
    Oct 20 20:18:42 local/tmm info tmm[4601]: Rule myrule : i - 6|client - 192.168.206.102:62984
    Oct 20 20:18:42 local/tmm info tmm[4601]: Rule myrule : i - 7|server - 10.10.70.110:80
    Oct 20 20:18:42 local/tmm info tmm[4601]: Rule myrule : i - 7|client - 192.168.206.102:62984
    Oct 20 20:18:42 local/tmm info tmm[4601]: Rule myrule : i - 8|server - 10.10.70.110:80