add hostname per #415 request to loki exports

This commit is contained in:
Cody Lee 2024-03-04 18:28:04 -06:00
parent 60e5c3d8b3
commit b87ee94111
No known key found for this signature in database
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,