Forum Discussion
can we capture specific URI value from uri path
Hi set captured_value [getfield [HTTP::uri] "/" 4] In above syntax instead of "/" 4, can we capture specific URI value from path like
https://www.abc.com/114/valueA=100/valueB=200
Can we catch value A and Value B
3 Replies
- Andy_McGrath
Cumulonimbus
As long as those are path and not query values and always in the same location as your example the following will get the data values from within the path:
set valueA [getfield [getfield [HTTP::path] "/" 3] "=" 2] set valueB [getfield [getfield [HTTP::path] "/" 4] "=" 2] - youssef1
Cumulonimbus
Hi,
2 solutions for you:
First solution:
set uri [HTTP::uri] regexp {^.*valueA=([^\/]+)\/valueB=(.*)$} $uri -> valuea valuebSecond solution:
set uri [HTTP::uri] set valuea [findstr $uri /valueA= 8 /] set valueb [findstr $uri /valueB= 8 end]Hope it will help you. keep me in touch.
regards,
- Stanislas_Piro2
Cumulonimbus
Hi,
you can use scan command, faster than regexp...
scan [HTTP::uri] {/%[^/]/valueA=%[^/]/valueB=%[^/]} garbage valueA valueB
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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