Forum Discussion
Chris_Miller
Altostratus
Nov 02, 2010Logging if certain HTTP Query Strings are Null
I have a query string that looks like the following: s_sample=test&t_sample=test&u_sample=test. I'm trying to determine the most effective way to log when s_sample, t_sample, or u_sa...
Chris_Miller
Altostratus
Nov 03, 2010Posted By hoolio on 11/02/2010 11:28 PM
If the query parameters are in the same order and consecutively listed, I think this will work:
scan [string range [HTTP::query] [string first "s_sample=" [HTTP::query]] end] {s_sample=%[^&]&t_sample=%[^&]&u_sample=%[^&]}
A more robust option would be to parse each parameter name and value using URI::query. But that seems like a lot of overhead if you're checking every request that has a query string. If you're only interested in requests to a specific URI, you could check for that first before using the scan command.
Aaron
Actually, I do only care about a specific URI. Thanks for that tip!
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