Forum Discussion
James_Wrubel_48
Nimbostratus
Jul 03, 2009regexp to parse querystring parameters
I am trying to get a list of querystring parameters from the URI. There's an example iRule that does this here:
http://devcentral.f5.com/wiki/default.aspx/iRules/URIInterrogation.html
Th...
hoolio
Cirrostratus
Jul 06, 2009If you have any string in the format of ?name1=value1&name2=value2, you can use URI::query to parse the value of any of the parameters:
set my_uri "?action=login&pref=2"
log local0. "[URI::query $my_uri "action"]"
This would output "login". If you've already removed the question mark when parsing the URI string, you could prepend it:
set my_uri "action=login&pref=2"
log local0. "[URI::query "?$my_uri" "action"]"
Aaron
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