Forum Discussion
Bryce_Halkerst1
Nimbostratus
Mar 12, 2013Header insert for lb server ip and tcp port
Working
X-Who-A
when HTTP_RESPONSE {
set server [string range [LB::server] 2 end]
set port [string range [LB::server port] 2 end]
HTTP::header insert "X-Who-A...
Bryce_Halkerst1
Nimbostratus
Jul 10, 2013All,
Not having any issues with the irule outputting the last 2 digits of the server tcp ports. Client changed the ports on the server end, so I need the first 2 digits. See below.
Thanks,
Bryce
Last Digits work great
rule myrule {
when HTTP_RESPONSE {
scan [IP::remote_addr] {%*d.%*d.%d.%d} c d
HTTP::header insert "X-Who-A" "AN-$c.$d-[TCP::remote_port]"
}
}
Tried this logic for the first 2 digits in the header insert. No dice!
rule myrule {
when HTTP_RESPONSE {
scan [IP::remote_addr] {%*d.%*d.%d.%d} a b
HTTP::header insert "X-Who-A" "AN-$a.$b-[TCP::remote_port]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects