The Search plugin

The search plugin allows you to execute arbitrary beanshell scripts to identify "interesting" conversations. You are provided with the request, response, and origin (originating plugin) of the conversation, and can use the class methods to return a true or false value. A true value indicates an interesting conversation that should be displayed, and a false value indicates that the conversation should not be displayed.

An example might be something like:

response.getContent() != null && new String(response.getContent()).matches("(?s).*[Ee](rror|xception).*")

which makes sure that the response HAS content (byte[]), before checking to see if a String constructed from that content contains any of the strings: Error, error, Exception, exception. The (?s) instructs the Java Regex algorithm to perform a multi-line match, i.e. enables the period to match a linefeed character.

BeanShell also does automatic JavaBean introspection, so in fact, the call to response.getContent() could also be written as "response.content", with BeanShell using the getters and setters appropriately.

For details of the class methods available, please consult the JavaDocs (included in the installer build) for org.owasp.webscarab.model.(Request|Response). Origin is simply a String matching the plugin name.