Hands-on task
Count server errors
The shop on this server (nginx, port 80) writes its access log to /var/log/app/access.log, where good requests and errors are mixed together. Open the Site tab above the terminal and browse the shop: the "Place an order" link currently fails with a 500 error, and every request you make lands in the log too. Count how many requests ended with status 500, and write the number (only the number) to /root/count.txt. Count over the whole log, your own requests included.
- grep
- grep -c
- regular expressions
- log parsing
- field boundaries