AnsweredAssumed Answered

How does introscope.agent.sqlagent.normalizer.regex.key1.replaceFormat work?

Question asked by thomas.krpata on Jul 9, 2014
Latest reply on Jul 10, 2014 by KulbirNijjer

I'm unclear on how the "introscope.agent.sqlagent.normalizer.regex.key1.replaceFormat" property works.


I'm using the properties specified below.

 

introscope.agent.sqlagent.normalizer.regex.SELECTS.pattern=SELECT([\\s\\S]*)

introscope.agent.sqlagent.normalizer.regex.SELECTS.replaceAll=true

introscope.agent.sqlagent.normalizer.regex.SELECTS.replaceFormat=SELECT

introscope.agent.sqlagent.normalizer.regex.SELECTS.caseSensitive=false

 

The issue is that the SQL SELECT statements contain varying amounts of whitespace, so, you end up with "normalized" output that looks like this:

 

[>.>]SELECT

[>.>]SELECT

[.>....]SELECT

[.>...]SELECT

[....>>]SELECT

...and so on

 

where [...] represents whitespace characters.

     . = space

     >=tab

 

What I'd like to see as a result is ALL such SELECT statements to be normalized into a single SELECT folder.

 

The doc suggests that standard Regex (java.util.regex) can be applied to the "replace.Format" property but I can't get it to recognize a RegEx that works. 

 

So, the solution I need is to apply a RegEx that squeezes out all of the whitespace contained in a token match.

 

Any suggestions?

 

Thanks!

Outcomes