Forum Discussion
Mike_Moniz
18 days agoProfessor
I think (did not test) that the regex needs to have ( ) around the part you want to extract.
But more importantly, datapoints must be numbers. So "Mon Jun 11" can't be put in a datapoint. Since you are already writing a script I would do all the extracting and math in the script itself and just output the final numbers. For dates I suggest converting them to epoch which is a single number LM can read. I would also convert it to DaysRemaining (or hours or minutes if preferred) and have a datapoint for that which you can alert against. It may still be useful to also output the raw date in text; although LM will ignore it, it does show up in Poll Now which is useful when reviewing an alert.
So I would output something like this in the script:
ExpirationDateRAW=Mon Jun 11 14:22:33 UTC 2029
ExpirationDate=1875896553
DaysRemaining=1649.161828703704
Related Content
- 6 months ago
- 2 years ago
- 3 months ago