DX Unified Infrastructure Management

 View Only
  • 1.  Logfile monitroing with date/time regex

    Posted Oct 15, 2019 09:59 PM
    What would be the regex to monitor a log file with the following name pattern:

    Application.20190916-141941.log
    Application.20191004-121003.log

    I have tried:
    Application.%Y%m%d-%H%M%S.log

    thanks


  • 2.  RE: Logfile monitroing with date/time regex

    Broadcom Employee
    Posted Oct 16, 2019 09:12 AM
    Matthew -

    That is the correct regex to match, but the logmon probe replaces the %Y%m%d-%H%M%S values with the system values at the time that the next scan interval runs.

    So if you have the file:

    Application.20191016-091003.log

    but the probe kicks of the next scan at 9:10:04 on October 16, 2019, the file will not be scanned since it will be looking for the file:

    Application.20191016-091004.log


    ------------------------------
    Kathy Maguire
    Technical Support Engineer 4
    Broadcom
    ------------------------------



  • 3.  RE: Logfile monitroing with date/time regex
    Best Answer

    Posted Oct 16, 2019 04:35 PM
    Note that if you have the case where it's possible to "miss" a file, you could use something like Application.%Y%m%d-*.log and set the mode to updates instead. then each time logmon itterates, it will see all files from that day, identify the ones that have been updated, and run your rules/watchers against those. Since it's likely that you'll only see updates to the most recent one (in the case it's currently still writing to the same file)  or two files (because it has rolled over to the new one since last read) it achieves roughly the same thing as explicitly specifying the name of the file full out.

    As an aside, I had been told that logmon will continue to read from a file that matched at one point but now no longer does as a result of the progression of time. I have never verified that and have no information to either support or contradict what I was told.



  • 4.  RE: Logfile monitroing with date/time regex

    Posted Oct 16, 2019 08:31 PM
    That works.

    Cheers guys.