🕰️ Inconsistent Time Zones in UniFi Logs

TL;DR: UniFi logs from different processes don't use a consistent time zone. CEF events are timestamped in UTC, while other logs use the local device time (which may include daylight savings). This inconsistency causes confusion and breaks correlation in SIEMs and log management systems. Ubiquiti should standardise on UTC for all events.

Looking at the logs from my UniFi Dream Machine Pro, it's clear that many different processes are responsible for providing all the awesome functionality it offers.

In my previous post, I pointed out that, in this day and age, timestamps should include time zone information. But at the very least, you'd expect that all processes on the same device use the same time zone, right?

Nope.

Take a look at this screenshot from my log management system:

Screenshot showing timestamp inconsistencies

First, you see an ingesttimestamp—the time when the log management system received the event. Then you see the raw event as sent by the UniFi Dream Machine.

Look at the highlighted timestamps. The third event is an hour earlier than the previous one. Why?

The CEF events use the UTC time zone for their timestamps.

I'm located near London, so my normal time zone is GMT (UTC+00:00). But right now it's summer, so we're using British Summer Time (UTC+01:00). Hence, the CEF events appear 1 hour behind events where the timestamp is in BST.

I spoke with another UniFi user with a UniFi Express 7 device. He's in Madrid, which is currently UTC+02:00 due to summer time. His logs? You guessed it—his CEF event timestamps are 2 hours behind the local (non-CEF) event timestamps.

To deal with this, I built a custom parser for my log management system. In the section that extracts the timestamp, I had to:

  • If it's a CEF event → treat the timestamp as UTC
  • If it's not a CEF event → treat the timestamp as /Europe/London

But I shouldn't have to deal with such shenanigans—figuring out whether different processes are timestamping events in UTC or local time, with or without daylight saving applied.

✏️ Dear Ubiquiti…

Please standardise the time zone across all logs emitted by UniFi devices. Ideally, stick to UTC for everything. Consistent timestamps are essential for any log management or SIEM solution that needs to correlate events across systems and locations.

Comments

Popular posts from this blog

Missing Fields in Teleport VPN Logs: Why the Remote IP Matters

📅 UniFi Logs and the Missing Time Zone: Why It Matters