Forum Discussion
Rostislav_Zatol
Nimbostratus
Nov 20, 2009replace IP in POST body with source IPaddr
Hello,
I am searching for possibility to replace in xml formated HTTP POST body an IPaddress with TCP source IP address.
I sure have to use STREAM. So something like this...
hoolio
Cirrostratus
Dec 11, 2009Hi RZ,
As I mentioned before, I don't think a stream profile/iRule will work for rewriting request payloads where the search and replace string are different lengths. The reason for this is that there is no way to update the Content-Length header. So the rewritten request payload won't be valid.
If you use HTTP::collect and HTTP::payload, LTM will update the Content-Length header for you.
Also, the reason [IP::client_addr] isn't working is that the curly braces prevent interpretation of variables and commands. This would allow variable expansion:
set client_ip [IP::client_addr]
STREAM::expression [subst -nocommands {@\"xsd:string\">\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}@"xsd:string">$client_ip@}]
Aaron
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
