Jump to: navigation, search

Regular Expressions

Genesys strongly recommends that you test the regular expressions that you want to use for indexing and scrubbing before you define them in the LFMT configuration.

Some suggestions:

  • Use tools like Regex Coach (http://www.weitz.de/regex-coach/) to test the syntax of the regular expressions.
  • Tune the performance using the provided Java Test utility. A test example is provided in the utilities directory. Syntax for Java Test: java RegexPerformanceTester.jar <file path> <regular expression for scrub> and <regular expression for index>.

    For example:
    java - jar RegexPerformanceTester.jar
    "E:\\PSS\\LFM\\AMR_US_Aus_OCS_P.20121226_
    110131_101.log" “AttributeUserData\s*(.+)" ":
    \sAttributeConnID\s(?:(\w+))"
    This utility reads a file, applies the regular expression to each line, and at the end shows the time used to traverse the file. Genesys recommends using a production log file for one of your Genesys applications as input for the test.
  • Use Lazy Quantifiers when defining expressions. It is more efficient and lets the regex engine decide when to stop. This method has been shown to be more efficient than Greedy Quantifiers for matching regular expressions. The examples below show the performance benefits of using Lazy Quantifiers.

    Test 1 – Lazy Quantifier

    regex = 'AttributeConnID\s*(.+)'
    [READ_BUFFER_SIZE: 104858010], [MAX_BUFFER_SIZE: 4096]
    Process the file took 2250 msec
    numberOfScrubs = 31477

    Test 2 – Greedy Quantifier

    regex = '\s.*AttributeUserData\s*(.+)'
    [READ_BUFFER_SIZE: 104858010], [MAX_BUFFER_SIZE: 4096]
    Process the file took 24703 msec
    numberOfScrubs = 31477
    For more information on Lazy Quantifiers, see http://msdn.microsoft.com/en-us/library/3206d374.aspx#Greedy. Create regular expressions to index and scrub pertinent information. This will increase performance of the LFMT. One notable suggestion would be to turn off the logging of user data at the application level rather than creating a new regular expression for each key value pair. These options are found in the log-filter-data section of the supported applications.
This page was last modified on February 14, 2014, at 11:04.

Feedback

Comment on this article:

blog comments powered by Disqus