Skip to content

Find peak 10-minute traffic window per day

Problem / use case

You want to track system reliability by identifying, for each day, the specific 10-minute time window that experienced the highest number of ERROR logs. This helps pinpoint the most critical time periods for troubleshooting.

Query

source logs
| filter $m.severity == ERROR
| groupby $m.timestamp / 10m as bucket.ts count() as bucket.count 
| groupby bucket.ts / 1d as day max_by(bucket.count, bucket) as bucket
| choose day.formatTimestamp('%d-%m-%Y') as day, bucket.count as count, bucket.ts.formatTimestamp('%d-%m-%Y %H:%M') as ts

Expected output

daycountts
23-05-2025581323-05-2025 10:40
22-05-2025451722-05-2025 10:50
20-05-2025204720-05-2025 15:40
21-05-2025477421-05-2025 11:10
24-05-2025274324-05-2025 11:10
25-05-2025333225-05-2025 11:20
26-05-2025355826-05-2025 11:50
27-05-2025337427-05-2025 11:00

Variations

  • Change the alert_severity to 'WARNING' or another level for different insights.
  • Adjust 10m to another duration like 5m or 30m depending on your granularity needs.
  • Include additional grouping fields like service_name to break down by component.