The report service restarted twice overnight. The on-call engineer checked its log and wrote: "No errors, grep error found nothing."
Repeat the on-call check
In ~/text-lab, run the two commands below: the on-call engineer's search and a look at the last five lines of the log.
Why did grep error find nothing, even though the log has an error?
-
grep checks every line to the end of the file:
grep listening service.logfinds lines both at the start of the log and at the end. -
Nothing writes to this log any more, and
tailhas already shown the error in it: grep reads the same whole file. -
Without read access grep would print
Permission denied. The file is yours — checkls -l service.log.
The log says ERROR in capitals, and the on-call engineer searched for error in lowercase.