January 2019
Intermediate to advanced
798 pages
20h 33m
English
Sometimes, we only want to know that an error was logged. In those cases, grabbing the whole line is good enough. But sometimes, the log line might contain an interesting substring, maybe a number of messages in some queue. A log line might look like this:
2015-12-20 18:15:22 Number of messages in the queue: 445
Theoretically, we could write triggers against the whole line. For example, the following regexp should match when there are 10,000 or more messages:
messages in the queue: [1-9][0-9]{4}
But what if we want to have a different trigger when the message count exceeds 15,000? That trigger would have a regular expression like this:
messages in the queue: (1[5-9]|[2-9].)[0-9]{3}
And if we want to exclude ...
Read now
Unlock full access