DX Unified Infrastructure Management

 View Only

  • 1.  Using Regular Expressions (primitive) for files isn't working

    Posted Sep 12, 2024 10:51 AM

    Hi Everyone.

    I need find with dirscan probe files with this structure, where:

    09= month, 12=day

    ATH0912001
    ATH0912002
    ATH0912003

    I see the documentation indicate that i can to use this call primitive --->

    Example from the documentation:

    I am configuring this structure but this is not working ---->

    ATH0912001 --  ATH%m%d001
    ATH0912002 --  ATH%m%d002
    ATH0912003 --  ATH%m%d003

    What i doing bad ?



  • 2.  RE: Using Regular Expressions (primitive) for files isn't working

    Posted Sep 16, 2024 04:20 AM

    I think that this is normal because the regex primitives for day, month, hour,... are only valid to define the directory names.




  • 3.  RE: Using Regular Expressions (primitive) for files isn't working

    Posted Sep 17, 2024 02:57 AM

    Hey guys, 

    I would bet that Luc is right.

    How about this?

    UNIX:

    Set logmon mode to command, fill it with this:

    a=`date +'%m%d'`; find <dir> -name "ATH${a}*" | wc -l 

    Set watcher rules to match any kind of number except 0, set Alarm/Suppression key for $FILENAME. 

    OS-nondependent 

    Set logmon mode to updates, set file name:
    UNIX: /<directory>/ATH%m%d*

    WIN: \<directory>\ATH%m%d*

    Set watcher rules to match anything - write down just asterisk (*) 

    Set alarm suppresion key for $FILENAME.

    Note that this only works if files are not empty.

    Hope this will help.

    Regards

    Petr




  • 4.  RE: Using Regular Expressions (primitive) for files isn't working

    Posted Sep 17, 2024 11:44 AM

    Hey @Luc Christiaens and @Petr Ketner Thanks to both for the comments and sugerence...!!!

    I can accomplish with the requiriment with dirscan probe because was necessary validate the files daily on hours specific.
    Basically i configured the profile to search files with RE: ATH([0][1-9]|[1][0-2])([0][1-9]|[12][0-9]|3[01])001 and watch age of newest file and < 1 minut. For the moment it's working...!!!



  • 5.  RE: Using Regular Expressions (primitive) for files isn't working

    Posted Sep 18, 2024 01:06 PM

    I can attest that in dirscan the regex %Y%m%d only validates that for example %m digits are within range 01-12.  Regex has no knowledge of current date to compare to the %m value.  All %Y%m%d does is validate that the digits meet a valid date format in terms of values.

    Our need was to match date stamp in filename to current date then count how many files exist.

    Workaround: I told my end user to write a script with output and schedule it, then I can solve it with logmon.  Didn't seem ideal since I like to keep directory and file scanning in dirscan for logical reasons, but it is a viable solution.