Regex in PBD
search cancel

Regex in PBD

book

Article ID: 199184

calendar_today

Updated On:

Products

CA Application Performance Management Agent (APM / Wily / Introscope) CA Application Performance Management (APM / Wily / Introscope) INTROSCOPE DX Application Performance Management

Issue/Introduction

 

Want to know what kind of regex characters can be used in order to match classes when using expressions like IdentifyMatchingClassesAs

The aim is to have two tracer groups, one for classes that have ".rest." and those that have ".restful.".

Using something like "*rest.*" or "*rest\.*" it will always bring the restful as well.


Environment

Release : 10.7.0

Component : APM Agents

Cause

 
 

Only wildcards can be used, no special characters

Trying to use ? for lookahead will result in AutoProbe errors

For example configuring this

     IdentifyMatchingClassesAs: *res(t?!f)* RestGroup

will result in this error

     [IntroscopeAgent.Agent] Introscope AutoProbe will not run because the provided directives files are not valid: (/test/wily/core/config/hotdeploy/regex.pbd:8) Syntax Error: Unsupported character "?".

 

Resolution

 

Along with a wildcard to match what you need inside IdentifyMatchingClassesAs, use skip directives to eliminate the classes you do not want to be part of the group.

For examples:

     SkipMatchingClassesForFlag
     SkipPackagePrefixForFlag

Additional Information

 

List of possible ProbeBuilder directives:

https://techdocs.broadcom.com/us/en/ca-enterprise-software/it-operations-management/application-performance-management/10-7/implementing-agents/probebuilder-directives-reference.html