Grokking DevOps and SRE Interviews
Vote

0% completed

​

Exercise: Building a grep Style Tool

grep -in timeout app.log worker.log
app.log:2:09:14:05 ERROR payment Timeout after 3000 ms app.log:4:09:14:09 WARN cart retry after timeout worker.log:2:09:15:03 ERROR job 42 timeout

This command searches two logs for "timeout" in any letter case and prints each matching line with its file name and line number. It then exits with code 0, because it found at least one line. Scripts read that exit code to decide what to do next.

One candidate report describes building a grep style tool in 45 minutes with built-in modules only

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content