Forum Discussion
Puli
Nimbostratus
Jul 27, 2010Traversing the URL and matching it with a datagroup
Hi All,
i have a requirement and wondering if you can help me out.
Lets say we have a url:
www.abc.com/aa/bb/cc/dd/ee
and my datagroup has entries for re-directs
aa zz
bb yy
cc xx
dd pp
I need to parse the URL and match each folder.
For example.
take /aa/bb/cc/dd/ee match it with datagroup , if i find a match then re-direct to target
if it does'nt match, strip the last folder from path and match
/aa/bb/cc/dd and match it with datagroup.
I need to go this way till a maximum of 10 loops or exist if i find a match.
I trying to understand whats the best way to handle this requirement without causing major impact to performance.
For a site with 100 hits /sec, i know our bigIP is a beefy machine and can handle but wanted to get some ideas and code snippets that are optimal.
thanks.
Puli.
1 Reply
- hoolio
Cirrostratus
Hi Puli,
Conceptually this could be done using various string functions (most likely URI::path or possibly split and/or scan) and the class command to check the datagroup. However, I'd be concerned about the possible resource utilization and latency added by doing recursive operations.
http://devcentral.f5.com/wiki/default.aspx/iRules/class
http://devcentral.f5.com/wiki/default.aspx/iRules/uri__path
http://www.tcl.tk/man/tcl8.4/TclCmd/split.htm
http://www.tcl.tk/man/tcl8.4/TclCmd/scan.htm
You might try building a simple test rule and do some performance testing of it under load while using timing to record the results:
http://devcentral.f5.com/wiki/default.aspx/iRules/timing
Aaron
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
