Forum Discussion
Telnet_178675
Nimbostratus
Apr 11, 2015Regular Expression - HTTP URI
How can i match on following :
-http://www.xyz.com/abc/"anything" >>> I want to match on http://www.xyz.com/abc/ with anything after "/abc/"
-http://www.xyz.com/abc/QW"anything" >>> I wa...
nitass
Employee
Apr 12, 2015I want to match on http://www.xyz.com/abc/ with anything after "/abc/"
I want to match on http://www.xyz.com/abc/QW with anything after "QW"you may try scan command.
% set uri1 "/abc/anythig"
/abc/anythig
% scan $uri1 {/abc/%s} var1
1
% put $var1
anythig
iRules 101 - 16 - Parsing Strings with the TCL Scan Command by Jason Rahm
https://devcentral.f5.com/articles/irules-101-16-parsing-strings-with-the-tcl-scan-commandI want to match on any value @ the Query string "cal"
URI::query
https://devcentral.f5.com/wiki/iRules.URI__query.ashx[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when RULE_INIT {
set uri1 "/abc.aspx?cal=anything"
log local0. "URI is $uri1 and parameter cal value is [URI::query $uri1 cal]"
}
}
[root@ve11c:Active:In Sync] config tail -f /var/log/ltm
Apr 12 15:55:39 ve11c info tmm1[5649]: Rule /Common/qux : URI is /abc.aspx?cal=anything and parameter cal value is anything
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
