Forum Discussion
jay_41157
Apr 12, 2011Nimbostratus
scrub out going traffic.
HI,
I need to be able to scrub the response going to the end user.
What I need is the F5 only send back data that is between the below tags and drop the rest.
.....
Any suggestions on how I can do this?
Thanks,
Jay
- James_Quinby_46Historic F5 AccountCould you post the tags again? This is probably something you'd want to use a STREAM profile for, but let's have a look to be sure.
- hooleylistCirrostratusHi Jay,
- jay_41157NimbostratusHere it is.
............
- hooleylistCirrostratus...
- hooleylistCirrostratusSo you could set the string expression to something like this:
STREAM::expression {@[^<]+@@}
when HTTP_REQUEST { Disable the stream filter for all requests STREAM::disable } when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains "text"}{ STREAM::expression {@[^<]+@@} Enable the stream filter for this response only STREAM::enable } }
- jay_41157NimbostratusThanks Aaron,
- jay_41157NimbostratusHi,
STREAM::expression {@[^<]+@@}
- Joel_MosesNimbostratusJay, you don't need to put anything in the stream profile with this iRule, you just need to make sure a stream profile is attached to the VS when the iRule is added to it. The iRule is actually switching on the stream replacement when it gets content of type "text" and setting the expression it is going to use... all you need to do is enable a (blank) stream profile on the VS.
- James_Quinby_46Historic F5 AccountAcademic question here - why not just apply the target/replace strings into a STREAM profile on the virtual? If it's a simple enough expression, I'm not sure what's gained by using an iRule here. Just curious.
- Joel_MosesNimbostratusYou can do that, sure. The iRule approach is a little better because it will allow you to precisely target specific content-types with the Stream match, and not apply to all content by default. Saves CPU and -- most importantly -- administrator brain cells when an overmatch occurs and they're forced to troubleshoot it. :>
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