Hello, looking for some RegEx help here.
It seems this is correct but when I test this out in the nas regEx tester I am getting no matches when I test with values of 0% or 5% works for 1% - 4%.
Our CDM disk throws disk alerts using this format:
- DISK - C:\ is now 2404 MB ( 2.3 GB - 2% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
- DISK - E:\ is now 0 MB ( 0.0 GB - 0% ), which is below the threshold 299427 MB ( 292 GB - 10% ) out of total size 2924.1 GB ( 100% )
Trying to create a nas rule that will match on all the alerts when the disk space hits [0% - 5%] space left, then do something.
The regEx I came up with that is semi-working is:
/.*-\s(0%|1%|2%|3%|4%|5%)\s\),\swhich*./
It works when the % is 1,2,3,4
DISK - C:\ is now 2404 MB ( 2.3 GB - 1% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
DISK - C:\ is now 2404 MB ( 2.3 GB - 2% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
DISK - C:\ is now 2404 MB ( 2.3 GB - 3% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
DISK - C:\ is now 2404 MB ( 2.3 GB - 4% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
but fails and does not match when 0% or 5%.
DISK - C:\ is now 2404 MB ( 2.3 GB - 0% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
DISK - C:\ is now 2404 MB ( 2.3 GB - 5% ), which is below the threshold 10230 MB ( 10 GB - 10% ) out of total size 99.9 GB ( 100% )
What am I missing here?
------------------------------
Daniel Blanco
Enterprise Tools Team Architect
DBlanco@alphaserveit.com------------------------------