Skip to content

Commit

Permalink
hide geoip related warnings (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus committed Aug 19, 2024
1 parent 2fbc214 commit 534fb14
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pkg/parser/enrich_geoip.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func IpToRange(field string, p *types.Event, plog *log.Entry) (map[string]string
}

if r == nil {
plog.Warnf("No range found for ip '%s'", field)
plog.Debugf("No range found for ip '%s'", field)
return nil, nil
}

Expand All @@ -49,10 +49,15 @@ func GeoIpASN(field string, p *types.Event, plog *log.Entry) (map[string]string,
r, err := exprhelpers.GeoIPASNEnrich(field)

if err != nil {
plog.Errorf("Unable to enrich ip '%s'", field)
plog.Debugf("Unable to enrich ip '%s'", field)
return nil, nil //nolint:nilerr
}

if r == nil {
plog.Debugf("No ASN found for ip '%s'", field)
return nil, nil
}

record, ok := r.(*geoip2.ASN)

if !ok {
Expand All @@ -78,10 +83,15 @@ func GeoIpCity(field string, p *types.Event, plog *log.Entry) (map[string]string
r, err := exprhelpers.GeoIPEnrich(field)

if err != nil {
plog.Errorf("Unable to enrich ip '%s'", field)
plog.Debugf("Unable to enrich ip '%s'", field)
return nil, nil //nolint:nilerr
}

if r == nil {
plog.Debugf("No city found for ip '%s'", field)
return nil, nil
}

record, ok := r.(*geoip2.City)

if !ok {
Expand Down

0 comments on commit 534fb14

Please sign in to comment.