Log parser
Paste log lines. ISO-8601 timestamps and 10-digit Unix seconds are highlighted and listed in order of appearance.
- No timestamps detected yet.
Related Guides & Tutorials
// developers also readLog Timestamp Analysis — Finding Patterns
Parse, normalize, and analyze timestamps from nginx, Apache, syslog, and application logs.
Elasticsearch Timestamp Indexing
Index log data by timestamp in Elasticsearch for fast time-range queries and real-time analytics.
Unix Timestamp Precision Guide
Understand precision issues when parsing high-volume log data with millisecond timestamps.
Terminal Equivalent
Rip epoch digits and structured dates out of logs using grep, awk, and GNU date.
# Extract all timestamps from a log file
grep -oP '\d{10}' /var/log/app.log
# Convert all timestamps in a log to readable dates
grep -oP '\d{10}' /var/log/app.log | \
while read ts; do
echo "$ts -> $(date -d @$ts)"
done
# Find log entries in a time range
awk -F'[][]' '{print $2}' access.log | \
awk -F/ '{print $3"-"$2"-"$1}' | sort | uniq -c
# Parse nginx access log timestamps
awk '{print $4}' /var/log/nginx/access.log | \
cut -c2- | sort | uniq -c
# Filter logs by date range using Unix timestamps
start=$(date -d "2024-12-01" +%s)
end=$(date -d "2024-12-07" +%s)
awk -v s=$start -v e=$end '$1>=s && $1<=e' timestamps.logHow It Works
Log files use many timestamp formats: Unix seconds, ISO 8601, Apache Common Log Format ([07/Dec/2024:04:00:00 +0000]), syslog format (Dec 7 04:00:00), and RFC 3339. Parsing requires identifying the format and converting to a common representation for comparison. The key challenge is timezone — logs from distributed systems may use different zones, making naive string comparison incorrect. Always normalize to UTC first.