Find Failed Requests and Extract Status Codes
Your Nginx server is reporting failed requests. Use the terminal to investigate the access log.
Start by finding requests with 4xx or 5xx HTTP status codes.
Then:
-
Use
grepto find failed requests. -
Use
awkto extract the HTTP status code. -
Use
sortto organize the results. -
Use
>to save the status codes tofailed-status.txt. -
Use
catto read the saved results.
The goal is to build a simple log-analysis pipeline:
grep → awk → sort → redirection → cat