Forum Discussion
stucky101_88485
Nimbostratus
Feb 23, 2013We have "getfield" I need "trimfield"
Gurus
This is one of those things you'd think is super simple but I've been pulling my hair out.
There appear to be many ways to trim any occurence of a char/string within another string li...
nitass
Employee
Feb 23, 2013e.g.
[root@ve10:Active] config b class trim_left_uri list
class trim_left_uri {
{
"/rma/"
"/test/"
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [set item [class match -name [HTTP::uri] contains trim_left_uri]] ne "" } {
set idx [string first $item [HTTP::uri]]
HTTP::uri [string replace [HTTP::uri] $idx [expr {$idx + [string length $item] - 1}] /]
}
}
}
[root@ve10:Active] config ssldump -Aed -nni 0.0 port 80
New TCP connection 1: 172.28.19.251(55448) <-> 172.28.19.252(80)
1361615316.4182 (0.0009) C>S
---------------------------------------------------------------
HEAD /rma/rma/something&rma=blalb HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
New TCP connection 2: 200.200.200.10(55448) <-> 200.200.200.101(80)
1361615316.4193 (0.0009) C>S
---------------------------------------------------------------
HEAD /rma/something&rma=blalb HTTP/1.1
User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
Host: 172.28.19.252
Accept: */*
---------------------------------------------------------------
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