Forum Discussion

Theo_Tolboom_17's avatar
Theo_Tolboom_17
Icon for Nimbostratus rankNimbostratus
Apr 14, 2015

Irule insert http header % issue

Hello,

 

I am working on a F5 which is configured with route domains. Several vips use the same irule that insert a http header, it insert the ip address of the vip.

 

HTTP::header insert BIGIP_VIP [IP::local_addr]

 

I found out that because of the route domains, it also inserts %2 afte the ip address For example, my vip is 10.10.10.10, my F5 insert 10.10.10.10%2 into the http header.

 

How do I change the irule so that it only inserts the ip address of the vip, and not the %2 of the route domain?

 

Cheers Theo

 

2 Replies

  • kunjan's avatar
    kunjan
    Icon for Nimbostratus rankNimbostratus

    Try this:

    HTTP::header insert BIGIP_VIP [getfield [IP::local_addr] "%" 1]

  • when HTTP_REQUEST {
        set local_addr [IP::local_addr]
        set trim_string "%2"
        set new_local_addr [string trimright $local_addr $trim_string]
        HTTP::header insert BIGIP_VIP $new_local_addr
    
    }