Forum Discussion
boneyard
Apr 25, 2012MVP
getting first part of uri
im looking for a way to only get the first part of an uri
so in all case i should only get test1
http://something/test1
http://something/test1/
http://something/test1/something
http://something/test1?value=8
findstr seems to be an interesting option, but i don't believe it can have several possibilities for the findstr command deliminator, so it terminates on for example / and ?, what would be a way to do this?
- hooleylistCirrostratusHi,
- hooleylistCirrostratusOr with better error handling:
if {[scan [HTTP::path] {/%[^/.]} dir] == 1}{ log local0. "parsed $dir" } else { log local0. "no dir parsed" }
- looks good, just wondering about the {/%[^/.]} part, can i just list multiple chars there i want to cause the value to be put in dir? like it is now, will it terminate on / and . ?
- i tested this and indeed, multiple chars are possible and it will trigger on any from the list, this does exactly what i need.
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