Hello,
I have a question about the automatically captured query string in web requests.
We can see the entire query string by grouping by "Application, URI and Query", however sometimes the query will contain parameters that have been randomly generated that cause the grouping to not be accurately reflected.
Take for example:
URI: /order.jsf Query: page=submit&mode=external&rnd=8796ba9876d7e7f
URI: /order.jsf Query: page=submit&mode=external&rnd=316d86e8b9a98s7
URI: /order.jsf Query: page=view&mode=external&rnd=72be76a87c68a34
URI: /order.jsf Query: page=view&mode=internal&rnd=61be97a6c9f9216
While we might be able to split this up using BTs, the data would still be useful except that the rnd parameter is going to be unique for every web request. This means that using "Application, URI and Query" OR "Application and URI" to group is not particularly useful.
A real example of this is disabling caching in jQuery which causes _=TIMESTAMP to be appended to the end of a query string.
So here is the actual question: Is it possible to filter out specific parameters from a query string, OR, is it possible to only include specific parameters? If it doesn't exist, what is the simplest way to implement this?
Thanks,
Andrew
Answer by Andrew P. ·
Hi Andreas,
Thanks for your help, it got me on the right track.
I didn't state it originally, but if the parameter didn't exist, I still wanted to capture the query string, I also wanted to capture an empty query string. Doing this allows me to split on both the URI and the query string (even URIs that don't have a query string).
So the BT splits on two measures, and the query string one looks like the following:
Note: I worked this out using easyTravel, it strips the date parameters off the end of the findJourney page query string (even though those values are always the same and would work regardless).
I am not an expert on regex and it could be that these expressions are inefficient, but I couldn't work out any other way. If there is a better way to have the same outcome, I'd be grateful to see it.
My logic behind each regex was:
Query: Get everything after a ? (not including the ?). If it doesn't exist, return an empty string
Transform: Look for the parameter fromDate (whether it's the first parameter, or not) and if it exists, return the entire query string before where it was found, otherwise return the entire query string.
I'll do some tests to see how efficient the regex is when I get a chance. If it's not bad, hopefully other people will find the above useful.
Andrew
Not a RegEx expert?? Well - this is more advanced than my typical RegEx
Your approach is correct in this case. It is better to use this one Measure for splitting on the complete URL (excluding the param you dont need) rather than having multiple measures for individual paramters and use all of them as individual split measures.
Keep us posted on our test results. Also - if the RegEx works out well feel free to add it to the following page: Useful Regular Expressions
Answer by Andreas G. ·
Hi Andrew
There is no way right now to tell the Servlet Sensor to capture just parts of the query string.
The Web Request Dashlet can also only group by the options you see in the context menu without any option to modify how the query string is evaluated.
That leaves you with the only option you have in this case: Business Transactions!
Using a BT for this:
You create a BT that splits using a Web Request - URI Pattern Measure. In this measure you can specify that you want the Query String evaluated. Using the Transformation RegEx you can get rid of the "rnd" portion of your Query String:
Hope this helps
JANUARY 15, 3:00 PM GMT / 10:00 AM ET