AppDynamics Application Intelligence Platform

3.8.x Documentation

PDFs

Videos

Release Notes

In AppDynamics you can use regular expressions (sometimes referred to as "regex") as an extension to simple pattern matching. Regular expressions enable you to combine similar transactions, rather than having to record and identify every variation. You can use regular expressions in custom match rules, custom exit points, and other configurations.

Regular Expression Engines

The App Agent for Java uses Java libraries for regular expressions. For more information see:

The App Agent for .NET uses the built in .NET regular expressions engine: For more information, see:

The App Agent for PHP uses PHP's built-in PCRE regular expression engine and requires the same syntax, including delimiters (for example: /^Foo/). For more information, see:

Regular Expression Examples

Custom Business Transaction Rules

Online retail applications might have URLs where the useful grouping information is distributed in different segments of the URI.  One example is http://RetailStore.com/store/jump/category/shoes/departments/view-all/cat630006p.  In this example, a useful business transaction might be to match on “/store/jump” and “all” to group all user requests to view all of an available category. A possible regex (regular expression) for this case is:

\/store\/jump.*\b?all\b


Consider the following REST URL: /myapp/card/{cardnumber}/session. Say, you want a transaction defined where the numeric card number is irrelevant. With URL patterns such as:

  • /group/1/nodsession/
  • /group/1/nodsession
  • /group/31/nodsession/
  • /group/2/nodsession

This regular expression will match:

/group/\d.*/nodsession\/?$

 

To group URLs that contain letters then numbers into one business transaction, such as the following:


But not match on this URL (because it has no digits after the letters)

Try the following:

mysite\.com/[a-z]+?[0-9]+?

 

Or, to handle upper case letters, the following:

 mysite\.com/[a-zA-Z]+?[0-9]+?

 

If you want it to match mysite.com/lettersnumbers.aspx more strictly, try this:
mysite\.com/[a-zA-Z]+?[0-9]+?\.aspx$

 

Backend Discovery Rules

For an example of a JDBC backend regular expression, see JDBC with complex URLs.

Regular Expression Testing Tools and Resources

You can find many regex testing pages and other resources online. 

http://regex101.com/#pcre - Regex101.com is a multi-purpose regex testing website where you can create and test regular expressions. The website supports JavaScript, PHP and other languages.

http://www.regexplanet.com/advanced/java/index.html - RegexPlanet is a regular expression test page for all known engines (languages): Java, JS, .NET, PHP and more.

http://www.regular-expressions.info/  - general purpose site with numerous resources, including quick starts, tutorials, examples, and more.

Java

http://java-regex-tester.appspot.com/ - a simple testing page for Java

.NET

http://www.regexlib.com/ - Regexlib is a .NET engine tester that also has a library of regular expressions and a list of resources.