Forum Discussion

Abhilash_Paul_2's avatar
Abhilash_Paul_2
Icon for Nimbostratus rankNimbostratus
Sep 14, 2017

define 30 minutes source ip persistence timeout in Irule

Anybody can help me to define 30 minutes source ip persistence timeout to below Irule.

 

when HTTP_REQUEST { set clientip "" if { [HTTP::header exists "X-Forwarded-For"] } { set clientip [HTTP::header "X-Forwarded-For"] } else { set clientip [IP::client_addr] } persist uie $clientip }

 

As of now it will remain only 3 minutes

 

Any help appreciated.

 

1 Reply

  • Hi Paul,

    Try this

    when HTTP_REQUEST { 
    
    set clientip "" 
    
        if { [HTTP::header exists "X-Forwarded-For"] } { 
    
            set clientip [HTTP::header "X-Forwarded-For"] 
    
        } else { 
    
            set clientip [IP::client_addr] 
    
        } 
    
        persist uie $clientip 1800 
    
    }
    

    You only need to add the amount of time in second in the "persist" command

    Hope it helps

    Give me a feedback please.

    Regards