Forum Discussion
Greg_91698
Nimbostratus
Mar 09, 2011iRule only runs once
I have a BigIP 3400 running BIG-IP 9.4.8 Build 355.0 Final. I am trying to do some payload replacement. I contacted tech support and they told me to ask here. I would have thought they would know ...
clazba
Nimbostratus
Mar 10, 2011Hi,
You should be able to achieve this relatively easily using the STREAM::replace command. Have a look at the example below.
when HTTP_REQUEST {
Collects the entire payload as per content lenght
HTTP::collect [HTTP::header Content-Length]
}
when HTTP_REQUEST_DATA
Sets var to string
set string_to_find [findstr [HTTP::payload] TAG 4 <]
log local0. "String $string_to_find identified in Request payload"
Release payload
HTTP::release
}
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
You can use strings or Regexs to match string (this one matches email addresses)
STREAM::expression {@[a-z0-9._%+-]+\@[a-z0-9.-]+\.[a-z]{2,6}@@}
Reenables the stream filter
STREAM::enable
}
when STREAM_MATCHED {
Sets data to replace
set data_to_replace "something"
Replaces string with var
STREAM::replace $data_to_replace
}
Cheers,
Claud
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