locked
RegEx Speed Searching Exchange Logs (VBScript and RegEx) RRS feed

  • Question

  • I need to search through a month of Exchange (EWS, EAS, OWA, and ECP) logs for each line containing certain user names. Using the following regex pattern I am able to get each log line containing one of the pertinent user names. The problem I have is the time this is taking. The search has been running for > 24 hours and it looks like it may take a week or more to complete. Do you have any ideas on improving performance or an alternate search method. I have included the basic script process after the pattern below.

    Pattern: (.*)((user1)|(user2)|(user3)|(user4)|(user5))(.*)

    1. Copy log to local system (Can't tax my prod servers with this)
    2. Read log into memory with FSO ReadAll
    3. Run RexEx Execute method against the data (This step takes a long time)
    4. Loop through results and write to a file

    Thank you,
    WP


    Will Perry

    Tuesday, July 14, 2015 10:19 PM

Answers

All replies

  • If you're talking about a lot of data, reading it all in just may be too much to handle.  Why don't you just walk through the data a line at a time and parse each line?

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

    Wednesday, July 15, 2015 2:27 AM
  • Log Parser would probably be faster than PowerShell and VBScript. If you deside to use Log Parser, you should also try Log Parser Studio.
    Wednesday, July 15, 2015 7:33 AM
  • Can you give a sample of log file

    better way is

    "$.+user[1-5].+^"


    Мнение высказанное мной не является официальным мнением компании Microsoft

    Wednesday, July 15, 2015 11:35 AM