Forum Discussion
Nick_Matthews
Cirrus
Aug 21, 2008Search and Replace with iRule
Hi,
I am hoping someone can help.
What I want to do is search in the header for a specific user agent and then find and replace a specific word in the html. Can some one...
Nick_Matthews
Cirrus
Aug 21, 2008OK,
I have looked into this again and found that using Stream might be the best option, so what I have so far is:
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text" and [HTTP::header "User-Agent"] contains "***"}{
Replace
STREAM::expression "@123@xyz@ @456@xyz@"
Enable the stream filter for this response only
STREAM::enable
}
}
However I also need to check the uri as I only want to replace on certain areas. How can I do this? Can I use HTTP_REQUEST with the HTTP_RESPONSE?
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