I'm writing regexes for log files to detect events. What I'm trying to do is detect if the phrase "restart-required"
appears in the logs, but the tricky part is, I want to ignore all the debug messages. Unfortunately, the logs aren't deliminated in any form, and just run together.
The good thing is, all my debug messages begin with 'Debug:'
and end with 'endmsg'.
What I've been able to put together so far is a regex to capture all my debug phrases.
/Debug:\s(.+?(?=endmsg))/gm
What I can't figure out from here is how to go about extending this to search for the phrase 'restart-required'
but ignore it if it's in one of these captured debug messages.
A regex101 of what I'm working with - https://regex101.com/r/zI1kM2/3
I'm not looking to capture phrases or anything around it, but just a boolean True
/False
to answer the question "Does the phrase 'restart-required'
occur somewhere in the logs outside of debug messages?"
Thanks!