Server logs · 03 Tools

Server logs: tools

Tools for logs: grep, awk and zgrep, Python and pandas, jq for JSON logs, platforms such as Elastic, OpenSearch and Splunk, Plaso for timelines, cloud audit logs, sha256sum, with an example run on a test log.

grep, awk and zgrep
Search, filter and count lines, even in compressed files, without changing them.
Python and pandas
For large volumes, statistics and repeatable time conversions.
jq
Reads logs in JSON format, typical of the cloud and modern applications.
Elastic, OpenSearch, Splunk
Collect and index millions of lines from different sources for searches and charts.
Plaso
Puts logs, files and other artefacts on a single timeline.
Cloud audit logs
Searches of the Microsoft 365, Google Workspace and AWS logs, to be exported before they expire.
sha256sum
Computes the hash that makes it possible to show that the copy has not changed.

Example run with Bash, awk and GNU date on 27 November 2026 on a ten-line test log, using addresses reserved for documentation.

Bash
$ sha256sum access.log
848039378f1ce0f279ebfbcc90e874b4e532835126dc4ac0e9a365e4591c49f9  access.log
$ wc -l access.log
10 access.log
$ awk '$9 == 401 {print $1}' access.log | sort | uniq -c | sort -rn
      6 203.0.113.7
      1 198.51.100.23
$ awk '$1 == "203.0.113.7" && $9 != 401 {print substr($4, 2), $7, $9, $10}' access.log
26/Nov/2026:03:13:02 /login 302 0
26/Nov/2026:03:14:10 /export/customers.csv 200 1843200
$ grep '^203.0.113.7 ' access.log | awk -F'"' '{print $6}' | sort -u
python-requests/2.31
$ date -u -d '2026-11-26 03:13:02 +0100' '+%Y-%m-%d %H:%M:%S UTC'
2026-11-26 02:13:02 UTC
Continue with
04 Pitfalls to avoid

Server logs: mistakes to avoid

The most common mistakes with logs: waiting, copying only part, opening the originals, trusting the time, forgetting the CDN, confusing address and person, relying on screenshots, ignoring gaps.

↑