From 6ee728cba6342631c6d8c66768200a6de5a25d3e Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Sun, 11 Dec 2022 14:29:13 -0600 Subject: [PATCH] add additional source data for issue #414 --- pkg/lokiunifi/report_ids.go | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/pkg/lokiunifi/report_ids.go b/pkg/lokiunifi/report_ids.go index c43e1614..5c2f4750 100644 --- a/pkg/lokiunifi/report_ids.go +++ b/pkg/lokiunifi/report_ids.go @@ -15,23 +15,26 @@ func (r *Report) IDS(event *unifi.IDS, logs *Logs) { } r.Counts[typeIDS]++ // increase counter and append new log line. - + logs.Streams = append(logs.Streams, LogStream{ Entries: [][]string{{strconv.FormatInt(event.Datetime.UnixNano(), 10), event.Msg}}, Labels: CleanLabels(map[string]string{ - "application": "unifi_ids", - "source": event.SourceName, - "site_name": event.SiteName, - "subsystem": event.Subsystem, - "category": event.Catname, - "event_type": event.EventType, - "key": event.Key, - "app_protocol": event.AppProto, - "protocol": event.Proto, - "interface": event.InIface, - "src_country": event.SrcIPCountry, - "usgip": event.USGIP, - "action": event.InnerAlertAction, + "application": "unifi_ids", + "source": event.SourceName, + "site_name": event.SiteName, + "subsystem": event.Subsystem, + "category": event.Catname, + "event_type": event.EventType, + "key": event.Key, + "app_protocol": event.AppProto, + "protocol": event.Proto, + "interface": event.InIface, + "src_country": event.SrcIPCountry, + "src_city": event.SourceIPGeo.City, + "src_continent": event.SourceIPGeo.ContinentCode, + "src_country_code": event.SourceIPGeo.CountryCode, + "usgip": event.USGIP, + "action": event.InnerAlertAction, }), }) }