Description:
Currently the parser only handles GET/POST requests. It's easy enough to add support for other request methods by changing checkMethod. The is a complete rewrite of a tool I wrote for myself earlier. The older algorithm was basic and did not provide the same level of flexibility I want, so I wrote a new one using a totally new algorithm. This implementation reads one line at a time using BufferedReader. When it gets to the end of the file and the sampler needs to get more requests, the parser will re-initialize the BufferedReader. The implementation uses StringTokenizer to create tokens.
The parse algorithm is the following:
- cleans the entry by looking for backslash "\"
- looks to see if GET or POST is in the line
- tokenizes using quotes "
- finds the token with the request method
- gets the string of the token and tokenizes it using space
- finds the first token beginning with slash character
- tokenizes the string using question mark "?"
- get the path from the first token
- returns the second token and checks it for parameters
- tokenizes the string using ampersand "&"
- parses each token to name/value pairs
Extending this class is fairly simple. Most access logs use the same format starting from the request method. Therefore, changing the implementation of cleanURL(string) method should be sufficient to support new log formats. Tomcat uses common log format, so any webserver that uses the format should work with this parser. Servers that are known to use non standard formats are IIS and Netscape.
@version $Revision: 1.10.2.1 $ last updated $Date: 2004/05/20 18:08:54 $Created on: June 23, 2003