Forum Discussion
replace IP in POST body with source IPaddr
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:
when HTTP_REQUEST {
STREAM::disable
if {[HTTP::header value Content-Type] contains "text" && [HTTP::method eq "POST"]}
{
STREAM::expression "@string\">\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}@IP::addr@"
STREAM::enable
}
}
Any suggestions else?
BR
RZ
- hoolio
Cirrostratus
Hi RZ,Note that although any size payload can theoretically be collected, the maximum size of a Tcl variable is 4MB with a smaller functional maximum after charset expansion of approximately 1MB. Any payload manipulation outside of calls to HTTP::payload should obey that limit. The 2nd example below includes the best practice logic to enforce that limit, including the suppression of response chunking to allow more accurate determination of collect length.
- Rostislav_Zatol
Nimbostratus
Hello, - hoolio
Cirrostratus
Hi RZ, - Rostislav_Zatol
Nimbostratus
It seems that I really have problem with content-Length. AP server denies if it doese not match :-( - hoolio
Cirrostratus
You can use subst with HTTP::payload like I did for the STREAM::expression example. - hoolio
Cirrostratus
ie, can you try this?
Recent Discussions
Related Content
* 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