Files
Prototype0645 6c08d43b4c fix(inputunifi): apply default_site_name_override to log entries
default_site_name_override is applied in augmentMetrics, which only the
metrics path goes through. Log entries leave by collectControllerEvents,
which reads its sites straight from getFilteredSites — where the override
is deliberately not applied — so events, alarms, IDS records and system-log
entries ship with the controller's stock site name.

Four of the five site-scoped log collectors were affected; collectAnomalies
already did this inline, which is what makes the omission visible.

The consequence is worst for a poller watching several UniFi OS consoles:
each one calls its only site "default", so their log entries are
indistinguishable downstream. In Loki every stream from those consoles lands
under site_name="Default (default)" no matter which console it came from,
and no relabeling downstream can separate them again — the information is
gone by then. That is precisely the case the option was added for, and it
works for the metrics from those same consoles.

Extract the check collectAnomalies was doing into overrideSiteName and call
it from all five, so the two paths agree.

Note that only Site.Name reaches an API path; Site.SiteName is a display
name throughout the library. The override is therefore safe here, which is
what applySiteNameOverride's own comment already says ("keeping default for
API calls").
2026-09-01 09:08:13 +02:00
..
2023-07-31 14:40:33 -05:00