Interview Prep/Real-World Interview/awk, sed, grep and jq one-liners

Count requests per hour from an access log with timestamps like `[09/Nov/2026:14:23:01 +0000]`.

IntermediateHands-onawk, sed, grep and jq one-liners
Answer
awk -F'[][]' '{split($2, t, ":"); print t[1]":"t[2]}' access.log | sort | uniq -c

Key trick → Using [ and ] as field separators isolates the timestamp. Splitting on : then gives the date and the hour.

All Real-World Interview questions Roadmap: Interview readiness

More on awk, sed, grep and jq one-liners