Merge pull request #683 from unpoller/loki-add-hostname

Loki Include Host name in alarm and events
This commit is contained in:
Cody Lee 2024-03-05 08:26:29 -06:00 committed by GitHub
commit feb888287e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,7 @@ func (r *Report) Alarm(event *unifi.Alarm, logs *Logs) {
Entries: [][]string{{strconv.FormatInt(event.Datetime.UnixNano(), 10), event.Msg}},
Labels: CleanLabels(map[string]string{
"application": "unifi_alarm",
"host": event.Host,
"source": event.SourceName,
"site_name": event.SiteName,
"subsystem": event.Subsystem,

View File

@ -21,6 +21,8 @@ func (r *Report) Event(event *unifi.Event, logs *Logs) {
Labels: CleanLabels(map[string]string{
"application": "unifi_event",
"admin": event.Admin, // username
"host": event.Host,
"hostname": event.Hostname,
"site_name": event.SiteName,
"source": event.SourceName,
"subsystem": event.Subsystem,

View File

@ -21,6 +21,7 @@ func (r *Report) IDS(event *unifi.IDS, logs *Logs) {
Labels: CleanLabels(map[string]string{
"application": "unifi_ids",
"source": event.SourceName,
"host": event.Host,
"site_name": event.SiteName,
"subsystem": event.Subsystem,
"category": event.Catname,